• Advertisement

Archived

This topic is now archived and is closed to further replies.

d3d lights

This topic is 5992 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
What kind of lights are you using, and what exactly are you doing, or trying to do?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement