supertuxkart / stk-code

The code base of supertuxkart
Other
4.52k stars 1.06k forks source link

Day/Night cycle in SuperTuxKart #2315

Open MatthewsSam opened 9 years ago

MatthewsSam commented 9 years ago

We got an engine that do all the rendering in real time which means we can simply change the sun and the sky to switch from a day track to a night track (this was proved with Cocoa Temple and Carnival).

The operation is very simple however there is some issues currently: 1) There is no way in stk to tell if a track is during day or night (the engine should know that to switch the sun according to the time)

2) There is no way to "switch" on/off some objects. Like lanterns, they should be not casting light nor blooming during day time

3) Maybe there is a possibility to do this partially with scripting according to @auriamg with the property Visible If in object properties

4) Maybe there is also a possibility to do a "true" day/night cycle, should be investigated with @Elderme however it's NOT a PRIORITY right now.

JulianSchoenbaechler commented 9 years ago

"2) There is no way to "switch" on/off some objects. Like lanterns, they should be not casting light nor blooming during day time" Except there is much fog in the track. -> Should be possible to let the track maker decide if lights should be enabled or switched off on daytime.

MatthewsSam commented 7 years ago

While not related, some work has been done regarding day/night tracks.

Now it's possible to flag tracks as night or day tracks which will enable/disable some effects, for instance kart headlights.

MatthewsSam commented 7 years ago

After discussing with Auria we decided to use the scripting to selectively load objects depending on the time of the track (if it's night or day).

Which means only one lantern for instance can be included in the library and the lantern will automatically switch on in night tracks. This is a small step however it means in theory then "we just have" to change the flag + the skybox and the rest will follow.

But day/night is not our current priority