d3d lights
i have a little problem:
my lights never look nice... they dont fade out smooth when reaching their maximum range.
i tried many settings for the attenuation parameters and some worked nice but i dont want to experiment with these values until it looks good. it would be better to calculate them from light range and brightness or something like that.
does somebody know a formula for that?
cody
Why don''t you find the distance from the light to the point where you want it to shine, make it a number between 0 and 1, and then mulitply it by the color values?
yes, would be nice, but i wont to use the d3d lights for fast hardware lighting.
your solution needs vertex shaders i think and im to silly for that.
so i need a formula to calculate the d3d attenuation values.
your solution needs vertex shaders i think and im to silly for that.
so i need a formula to calculate the d3d attenuation values.
If you only need a simple solution for ie. illumination in a dungeon you can use directional light and fog. I think it looks fine.
Zeblar Nagrim, Lord of Chaos
Zeblar Nagrim, Lord of Chaos
ok, i will explain.
im using the normal d3d8 point lights. the struct has 3 attenuation values and one for light range.
i pick the range i want and then try to find attenuation values that cause the light to fade out smooth over distance until it reaches its maximum range.
now i change the light range and the light doesnt fade out smooth any more. a bit beforce range it has 50% of its brightness and then drops immediately to 0.
i could test other attenuation values once again, but i want these values to be calculated by my program not by the user.
hope you understand this.
cody
im using the normal d3d8 point lights. the struct has 3 attenuation values and one for light range.
i pick the range i want and then try to find attenuation values that cause the light to fade out smooth over distance until it reaches its maximum range.
now i change the light range and the light doesnt fade out smooth any more. a bit beforce range it has 50% of its brightness and then drops immediately to 0.
i could test other attenuation values once again, but i want these values to be calculated by my program not by the user.
hope you understand this.
cody
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement