Game Development Community

ScatterSky

by Joshua Halls (Xerves) · in Torque 3D Professional · 05/21/2009 (3:12 pm) · 9 replies

Any documentation floating around for this? Would love to see it animated. It does seem if you mess around with the elevation it is properly darkening everything and it isn't passing shadows and lights from under the terrain. Messing with some of the other values it seems you can change around the color a bit to give it a "sunset" like feel as well.

www.therepopulation.com/screenshots/scattersky.jpg

About the author

Part of the team that works on The Repopulation, a SciFi based MMO using a heavily modified version of the Torque MMO Kit - T3D. I also take care of the T3D version of the Torque MMO Kit.


#1
05/21/2009 (3:30 pm)
You can use the TimeOfDay object to animate it.
#2
05/21/2009 (3:32 pm)
Nod, just found that a few seconds ago. Thanks Ross. It is in the level folder (instead of Environment).
#3
05/21/2009 (3:32 pm)
I've got it working and animating... I just played around with the settings until I got something nice looking. There's a tick box named "play" that animates it... but I think there was a precondition for it to work right, but I can't remember what I did to make it function 100%. I just know I have scattersky and a cloud layer

Edit: Oh, of course, time of day. :-p
#4
05/21/2009 (3:41 pm)
Yea its not documented at all really. We're still making adjustments to it that will probably change how it works for beta 3.

A few notes to help those experimenting with it.

If you add a TimeOfDay object to the scene it will automatically start animating the sky.

The coloration is based on the mie and rayleigh scattering values, viewerHeight, and sunBrightness.

NightColor is just the fixed color it transitions to at night time.

sunScale and ambientScale allow you to tweak the output lighting values applied to the sun light calculated by the scattering terms... it does not affect the look of the sky.

That should get you started experimenting with it.


#5
06/05/2009 (12:43 pm)
I have an issue with it working properly. I added the scattersky and a cloud layer, looks great. When I turn my character at certain angles or look up/down at certain angles the scene lights up bright then turn a couple degrees and it's all back to normal. I'm guessing the camera veiw angle vs the light angle might have some issues. I set the azmuth and elevation to odd values trying to see if it was the zero bug but same thing.
#6
06/05/2009 (12:50 pm)
Have you deleted the sun? The scattersky provides its own sunlight, and it causes problems when used together with a sun object.
#7
06/05/2009 (1:10 pm)
That fixed it. Yeah 2 light sources and 2 light calculation types would be an issue.
The sky base color is a blue any way of changing that? I messed with the colors but couldn't get it to change.
Also I noticed with the timer on when the sun goes down below the horizion it gets really black out then switches to a lighter ambient I have set. So the ambient has to be black? I am sure this is due to the light calculation from the sun no longer affects the scene but at the point of where you set the ambient the calculation should stop darkening the scene. Sounds like some engine snooping to find it.
Thanks for the help....
#8
06/05/2009 (1:44 pm)
The scatter sky, as the name implies, uses algorithms that model the real sky color gradient based on sun position and a few other parameters, so you don't have a direct access to the base color. Check the view height and exposure to achieve some different effects.

It will need to be made a little more flexible to allow for non-Earth skies.
#9
06/05/2009 (2:29 pm)
The only minor bug I've found within the ScatterSky implementation (and I haven't posted this to the boards yet) is when you don't delete your skybox and add a ScatterSky. Once you save and then come back to your game (playing or editing) later your ScatterSky sun and sky is no where to be found (it's covered up by the skybox), but the lighting from it stays.

It's not a big deal, but a feature I've always wanted there to be more of is another level of error checking similar to when you try to add a road or river to a ground plane, it'll give you an error asking you if you want to add a terrain to complete the operation. Like I said, it's not a big deal, but it'd help.
#10
02/01/2010 (11:19 pm)
@Joshua what settings did you use to get those colors?