### ScatterSky Sun color

Scripting questions, discussions, etc
• 1
• 2

#### ScatterSky Sun color

Hodo33
Posts: 51
Joined: Fri Dec 29, 2017 4:34 pm
I have played with most all the variables on a scattersky and I can't change the sun color. In game it is pure white and the sun is kind of yellow in reality. Any changes I make to sunscale or colorize etc just turns the whole scene yellow. In the code:
mSunColor.set( 0, 0, 0, 1.0f );
mSunScale = ColorF::WHITE;
wont just change the sun it colors the whole scene, clouds and all. Anyone got a cool trick ?

#### Re: ScatterSky Sun color

fLUnKnhaXYU
Posts: 53
Joined: Wed Nov 15, 2017 8:19 am
I think that it might be that it uses the file art/lights/corona.PNG , which is white .

#### Re: ScatterSky Sun color

marauder2k9
Posts: 215
Joined: Wed Feb 18, 2015 7:36 am
The properties under the scattersky have nothing to do with the sun at all, they are just there for how the lighting affects the scene. As far as i know the sun in torque is just a white disc with glow applied to it and the only way to change it is by changing the hlsl file for the scattersky, i think anyway the rayleigh colour is affected by the time of day to give that colour glow of yellow outside the main disc

EDIT: Im an idiot, rayleigh affects the colour of the sky not the sun sorry but it is in scattersky hlsl file somewhere
Last edited by marauder2k9 on Sat Oct 13, 2018 3:47 am, edited 2 times in total.

#### Re: ScatterSky Sun color

marauder2k9
Posts: 215
Joined: Wed Feb 18, 2015 7:36 am
if you play around with time of day you can see this happening

#### Re: ScatterSky Sun color

Hodo33
Posts: 51
Joined: Fri Dec 29, 2017 4:34 pm
@marauder that picture almost proves my point, go out and look at the sun at sunset and the sky around it. With all the variables in there I think it should be closer.

Looking at the shaders/common/scattersky pixel and vertex doesn't show the color of the sun specifically.. I'll keep digging seems like it would be easy to just set 2 or 3 colors and lerp to the time of day but .... thanks for the reply

@ fLUnKnhaXYU I changed the corona graphic and material to blues and greens and no difference on the sun in scattersky ... thanks ...

#### Re: ScatterSky Sun color

fLUnKnhaXYU
Posts: 53
Joined: Wed Nov 15, 2017 8:19 am
I couldn't find anything on a corona color for the scattersky sun . All I can figure is that scatters the colors from a point which is the center of a sun . IDK , I couldnt see where it adds a sun object , just generates the sky coloring using the rayleigh setting .
you might try these settings
sunSize = 50
rayleighScttering = 0.2
meiScattering = ??? - I think this is more for objects in the sky (maybe something like 0.0045)
flareType = null - you can add you own flare , any color .

i used a medium blue color for colorize . you should get a sun area that is mostly the colorize color with a small amount of bright or scattered color . If it doesnt make sense Im probably just not expressing it well . Torque 3D documentation release 3.5.1 at readTheDocs page 82 Scatter Sky .

#### Re: ScatterSky Sun color

marauder2k9
Posts: 215
Joined: Wed Feb 18, 2015 7:36 am
As you can see from this changing the rayleigh changes the sun colour but it affects the entire scene lighting too, its very hard to get true colouring with this but you can get a sun with a yellow after glow with okay lighting

#### Re: ScatterSky Sun color

fLUnKnhaXYU
Posts: 53
Joined: Wed Nov 15, 2017 8:19 am
I think I get what youre saying now . Theres a little on sunColor in both the scatterSky.CPP and the timeOfDay.CPP maybe youll see something there . Seems that putting a corona at the point in time of day would do it , then you could reduce the size for the scattersky sun to 0 and just use the corona and lighting settings . I found that slightly dimly lit look quite appealing . Im having a little trouble in finding some useful range for the MIE Scattering value , I cant see any change in the lighting .

heres another setting if you'd care to try it , its basically the same , with an orange light all the way across .
   new ScatterSky(testSSky) {
skyBrightness = "0.6";
sunSize = "100000";
colorizeAmount = "80";
colorize = "0.388235 0.388235 0.968628 1";
rayleighScattering = "0.5";
sunScale = "0.996 0.996 0.988 1";
ambientScale = "0.302 0.302 0.298 0.184";
fogScale = "0.976471 0.984314 0.996078 1";
exposure = "999999";
zOffset = "0";
azimuth = "0";
elevation = "35";
moonAzimuth = "0";
moonElevation = "45";
staticRefreshFreq = "8";
dynamicRefreshFreq = "8";
brightness = "1";
flareType = "NullLightFlare";
flareScale = "2";
nightColor = "0.0313726 0.0313726 0.0313726 1";
nightFogColor = "0 0 0 1";
moonEnabled = "1";
moonMat = "Moon_Glow_Mat";
moonScale = "0.02";
moonLightColor = "0 0 0 1";
useNightCubemap = "1";
nightCubemap = "NightCubemap";
attenuationRatio = "0 1 1";
texSize = "512";
overDarkFactor = "2000 1000 500 100";
numSplits = "4";
logWeight = "0.91";
lastSplitTerrainOnly = "1";
representedInLightmap = "1";
shadowDarkenColor = "0.301961 0.313726 0.207843 0";
position = "-11.431 6.11889 100.864";
Rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
mieScattering = "0.0008";//----------this might be weird but Im not seeing much affect from changes to this setting
};

#### Re: ScatterSky Sun color

Hodo33
Posts: 51
Joined: Fri Dec 29, 2017 4:34 pm
@Flun not sure the sunsize of 100000 is correct I use 0.15 since the stock size is way to big and exposure of 9999999 would way overdrive the clouds visual.
Any devs care to chime in on this? There is a huge struct and calculation for what I feel is a unnatural look. If I could just make a yellow sun I can be happy for now. Thanks .....

#### Re: ScatterSky Sun color

Duion
Posts: 1133
Joined: Sun Feb 08, 2015 1:51 am

How did you get to sunsize 100000?
The correct size of the sun would be 1391980000.
• 1
• 2

#### Who is online

Users browsing this forum: No registered users and 3 guests