The Industry's Foundation for High Performance Graphics

1. day-night cycle light

Hey

Anybody know of a tutorial explaining how to achive day-night cycle light?

I was wondering if you could just change the color and intensity of global light but not sure on wich colors to use.

Any help apriciated

2. Re: day-night cycle light

For the Sun light :
1) full sun : 255,255,220
2) dawn/dusk, linear fade to : 255, 60, 60
3) then to : 0, 0, 0
During 2, spawn a second light source, like the moon, with a blueish tint, like 20, 60, 180, placed 180° opposite to the sun.
Don't forget to rotate both lights around your scene.
Some sky gradients may be nice too, from blue to orange to black.

For something more realistic, for both the sun and sky, search for Mie and Rayleigh scattering functions, like these :
http://http.developer.nvidia.com/GPU...chapter16.html
http://forum.celestialmatters.org/vi...r=asc&start=60

3. Re: day-night cycle light

Also check out the Preetham sky model, which is very good for generating nice sky gradients. The major limitation of it is that it does not support clouds in its simplest form. Further information on the Preetham model is available on the net.

4. Re: day-night cycle light

thanks,these info are valuable。

5. Re: day-night cycle light

thanks so much for the info!

I'll look into it!

6. Re: day-night cycle light

This is a big overkill for me.

I was going to simply use the global light so what I was looking for was a function that gives intensity (and rgb?) according to the time.

ZbuffeR was the most approximated thing but I was looking for soft changes. I will probably just change intensity according to time and do a couple of ifs for colour changes.

If anybody has a better ideas, I'm all ears

Thanks again!

7. Re: day-night cycle light

I was looking for soft changes
Well that is what I meant when saying "linear fade to".
I supposed you knew how to do a simple LERP from color to color.
Do the lerp independently for each channel in parallel, that will be smooth.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•