Day/night cycle
by Andy S. · in Torque Game Engine Advanced · 07/05/2007 (1:25 pm) · 10 replies
Hi,
i know there was a resource for day/night cycles in TGE. Has anyone tried to implement such a feature into TGEA? Is it possible in script, or is it necessary to change the engine source to make this available? I am grateful for any help...i am a noob at TGEA and try to find my way around while building my game.
Cheers
andi
i know there was a resource for day/night cycles in TGE. Has anyone tried to implement such a feature into TGEA? Is it possible in script, or is it necessary to change the engine source to make this available? I am grateful for any help...i am a noob at TGEA and try to find my way around while building my game.
Cheers
andi
#2
This is ultimately an extremely inefficient way to do day and night cycles. I think the best way would be to have some sort of atmospheric scattering shader linked to the sun's position.
07/05/2007 (1:46 pm)
I set up fake transitions a while back by updating the DRLMultiplier. function DayNight()
{
Sun.apply();
Sun.DRLMultiplier = Sun.DRLMultiplier + $x;
if (Sun.DRLMultiplier > 1.8)
$x = -0.01;
if (Sun.DRLMultiplier < 0.2)
$x = 0.01;
schedule(1000, Sun, DayNight);
}This is ultimately an extremely inefficient way to do day and night cycles. I think the best way would be to have some sort of atmospheric scattering shader linked to the sun's position.
#3
07/05/2007 (2:16 pm)
Thanks guys for the answers...i guess then i postpone the day/night for the time being. In the end it would be more a eye-candy feature for me, not a gameplay-necessary one.
#4
07/05/2007 (3:11 pm)
Dream Games old Titas project had some day/night transition code for TGEA. However, I haven't updated in a long time, last I checked it only worked with Legacy terrain.
#5
07/06/2007 (8:00 am)
That's really because Atlas terrains are (right now) unaffected by any lighting. As soon as that is corrected then the Titas code will work.
#6
07/06/2007 (9:18 am)
Yeah unfortunately I'm not holding my breath on that one though. Doesn't sound like it's coming any time soon.
#7
07/06/2007 (12:08 pm)
Well, the new lighting system works with Atlas. It's just shadowing that doesn't work. The major problem is there's so much to making decent day/night cycles. You'd need a constantly changing skybox, correct outside shadowing, and correct outside color values. There are some great demos floating around. A really amazing demo is the ShaderX3 "A Practical Analytic Model for Daylight."
#8
07/06/2007 (12:52 pm)
Well when I say that the Atlas terrain is "unaffected" by lighting I mean it's texture does nothing. You can change the Sun colour and intensity all you want, but the Atlas texture will remain the same. Additionally, static shadows don't work on Atlas. So that means any Interior or TSStatic object will not cast a shadow onto Atlas. Basically, all lightmap-related operations don't happen on an Atlas terrain.
#9
07/06/2007 (1:14 pm)
Right, but again that's shadowing. I agree it's definitely a huge problem, but the lighting system does work with Atlas as seen here:
#10
07/06/2007 (1:28 pm)
Oh sorry, yes. Those dynamic "sg" lights do work, you're right. "Sun" light, and static shadowing do not work. All "dynamic" light stuff does work.
Associate David Montgomery-Blake
David MontgomeryBlake