Jump to content
  • Advertisement
Sign in to follow this  
staticVoid2

from day to night

This topic is 3405 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

hi there, I was wondering if there is any way to optimize lighting calculations for a light source that is semi-dynamic i.e. the sun or any other light source that has a fixed path in a 3d scene. I was thinking I could store lightmaps for certain different times of day and then somehow blend these at runtime, but I don't think that would work because shadows would not be accounted for if the key light positions skiped over and object that was occluding another object. and would interpolating between the lumels of the light map even produce the right effect? i.e. if the light source moves in a linear direction? I've saw a few games that use this effect quite well like gta, but how do they do it in real-time?

Share this post


Link to post
Share on other sites
Advertisement
If your terrain is a height map and your sun is exactly vertical at noon, you can use a version of horizon mapping that is very cheap and gives very good results. You need a (rather low resolution) 2-channel texture map that covers the whole terrain. In the first channel you store the angle at which the sun rises and in the second channel you store the angle at which the sun sets. Since your terrain is a height map, this works. A point on terrain can never be lit more than once a day. I'm thinking that Far Cry 2 uses this technique for their very distant terrain (beyond the last cascade of their shadow maps). The map is computed as you hit the "Make Beautiful" button.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!