Jump to content
Sign in to follow this  
mole_man

Darken ground with altitude

Recommended Posts

Getting some great results fiddling with PTA. Thanks for the tool.

I was trying to think about how to darken the terrain with altitude, reducing the light level of the ground in linear line from say 10,000 ft. Writing that expression is way beyond me.

If it is possible to do, I would appreciate help in getting an expression to work.

Share this post


Link to post
Share on other sites

Here an example of how to lower terrain lighting when going higher :

1.0 - ( cb_altitude / 13000 * 0.2 )

On ground level you have a terrain brightness of 1.0

Up to 13000 m it is lowered gradually till it is 0.2 lower ( so 0.8 ).

At 6500 m : 1.0 - ( 6500 / 13000 * 0.2 )  =  1.0 - ( 0.5 * 0.2 ) = 1.0 - ( 0.1 ) = 0.9

 

regards, Gerard

 


13900 8 cores @ 5.5-5.8 GHz / 8 cores @ 4.3 GHz (hyperthreading on) - Asus ROG Strix Gaming D4 - GSkill Ripjaws 2x 16 Gb 4266 mhz @ 3200 mhz / cas 13 -  Inno3D RTX4090 X3 iCHILL 24 Gb - 1x SSD M2 2800/1800 2TB - 1x SSD M2 2800/1800 1Tb - Sata 600 SSD 500 Mb - Thermaltake Level 10 GT case - EKWB Extreme 240 liquid cooling set push/pull - 2x 55’ Sony 4K tv's as front view and right view.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 1x 65” Sony 4K tv as left view.

FOV : 190 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Share this post


Link to post
Share on other sites

Terrein Lighting where you put the sun value ( Diffuse )


13900 8 cores @ 5.5-5.8 GHz / 8 cores @ 4.3 GHz (hyperthreading on) - Asus ROG Strix Gaming D4 - GSkill Ripjaws 2x 16 Gb 4266 mhz @ 3200 mhz / cas 13 -  Inno3D RTX4090 X3 iCHILL 24 Gb - 1x SSD M2 2800/1800 2TB - 1x SSD M2 2800/1800 1Tb - Sata 600 SSD 500 Mb - Thermaltake Level 10 GT case - EKWB Extreme 240 liquid cooling set push/pull - 2x 55’ Sony 4K tv's as front view and right view.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 1x 65” Sony 4K tv as left view.

FOV : 190 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Share this post


Link to post
Share on other sites

Had to go a bit deeper to get it to work. Just reducing the diffuse was not getting the full effect, and was also reducing down to black higher up, so I needed to clamp it. I think I have worked out a solution, but the maths is not that elegant, and appreciate input if there is a better way to do it.

The aim is to reduce the brightness of terrain, and buildings up to an altitude of 25,000 ft (more realistic for UK winter flying), then clamp it there. I have come up with;

[LIGHTING_TERRAIN_LIGHTING]
IsActive=1
SunDiffuseCoeff=(clamp(3.0 - (cb_Altitude/3048), 0.4, 2.4))
SunAmbientCoeff=(clamp(0.72 - (cb_Altitude/12700), 0.1, 0.6))
MoonDiffuseCoeff=1.50
MoonAmbientCoeff=1.00

[LIGHTING_AUTOGEN_LIGHTING]
IsActive=1
SunDiffuseCoeff=(clamp(3.0 - (cb_Altitude/3048), 0.5, 2.4))
SunAmbientCoeff=(clamp(0.72 - (cb_Altitude/12700), 0.1, 0.6))
MoonDiffuseCoeff=0.8
MoonAmbientCoeff=0.5

[LIGHTING_TERRAIN_SATURATION]
IsActive=1
SaturateRatio=(clamp(0.9 - (cb_Altitude/38100), 0.7, 0.9))

Before the tweak

beforetweak.jpg

 

After the tweak

aftertweak.jpg

Using this formula, the darkening effect does not start until around 6000 ft

If you want to try the formulas, you will probably need to fiddle with the values to fit your preset, HDR lighting etc.

The last two figures are the clamp figures, so you can use those to constrain the results, especially the lower figure. Set to a higher number and it won't get so dark.

Share this post


Link to post
Share on other sites

Bear in mind that the overall sunlight is already different in all seasons. So in the winter everything is darker than in the summer.  Also the sky.

And by climbing the scenery also gets a little darker.

It might be a good idea to darken AG as It sometimes can be seen at a too high altitude.


13900 8 cores @ 5.5-5.8 GHz / 8 cores @ 4.3 GHz (hyperthreading on) - Asus ROG Strix Gaming D4 - GSkill Ripjaws 2x 16 Gb 4266 mhz @ 3200 mhz / cas 13 -  Inno3D RTX4090 X3 iCHILL 24 Gb - 1x SSD M2 2800/1800 2TB - 1x SSD M2 2800/1800 1Tb - Sata 600 SSD 500 Mb - Thermaltake Level 10 GT case - EKWB Extreme 240 liquid cooling set push/pull - 2x 55’ Sony 4K tv's as front view and right view.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 1x 65” Sony 4K tv as left view.

FOV : 190 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Share this post


Link to post
Share on other sites
11 hours ago, mole_man said:

The aim is to reduce the brightness of terrain, and buildings up to an altitude of 25,000 ft (more realistic for UK winter flying), then clamp it there. I have come up with;

[LIGHTING_TERRAIN_LIGHTING]
IsActive=1
SunDiffuseCoeff=(clamp(3.0 - (cb_Altitude/3048), 0.4, 2.4))
SunAmbientCoeff=(clamp(0.72 - (cb_Altitude/12700), 0.1, 0.6))
MoonDiffuseCoeff=1.50
MoonAmbientCoeff=1.00

[LIGHTING_AUTOGEN_LIGHTING]
IsActive=1
SunDiffuseCoeff=(clamp(3.0 - (cb_Altitude/3048), 0.5, 2.4))
SunAmbientCoeff=(clamp(0.72 - (cb_Altitude/12700), 0.1, 0.6))
MoonDiffuseCoeff=0.8
MoonAmbientCoeff=0.5

[LIGHTING_TERRAIN_SATURATION]
IsActive=1
SaturateRatio=(clamp(0.9 - (cb_Altitude/38100), 0.7, 0.9))

To make others understand these expressions :

25000 ft = 7620 m

SunDiffuseCoeff=(clamp(3.0 - (cb_Altitude/3048), 0.4, 2.4))  —> direct sunlight on the terrain

Minimum value = 0.4 

Maximim value = 2.4

Starting value = 3.0

At 0 m altitude : 3.0 - 0 = 3.0 —> max value 2.4       —> 3.0 - ( 0/3048 ) = 3.0 - 0 

At 1000 m altitude : 3.0 -  0.33 = 2.67 —> max value 2.4     —> 3.0 - ( 1000/3048 ) = 3.0 - 0.33

At 1968.5 m altitude : 3.0 - 0.6 = 2.4     —> 3.0 - ( 1968.5/3048 ) = 3.0 - 0.6 

So above 1968.5 m ( 6458.33 ft ) the diffuse lighting starts to get less till the min value of 0.4 , which will be at 7925 m ( 26000.66 ft )

At 5000 m altitude : 3.0 - 1.95 = 1.05     —> 3.0 - ( 5000/3048 ) = 3.0 - 1.95

Any higher than 7925 m ( 26000.66 ) and it will stay at the minimum value of 0.4.

At 10000m altitude , which is above 26000.66 ft : 3.0 - 2.6 = 0.4     —> 3.0 - ( 10000/3048 )  —>   3.0 - ( 3.28 ) = - 0.72 which is less than the minimum of 0.4 , so the value will be 0.4

 

 

 

 

 


13900 8 cores @ 5.5-5.8 GHz / 8 cores @ 4.3 GHz (hyperthreading on) - Asus ROG Strix Gaming D4 - GSkill Ripjaws 2x 16 Gb 4266 mhz @ 3200 mhz / cas 13 -  Inno3D RTX4090 X3 iCHILL 24 Gb - 1x SSD M2 2800/1800 2TB - 1x SSD M2 2800/1800 1Tb - Sata 600 SSD 500 Mb - Thermaltake Level 10 GT case - EKWB Extreme 240 liquid cooling set push/pull - 2x 55’ Sony 4K tv's as front view and right view.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 1x 65” Sony 4K tv as left view.

FOV : 190 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Share this post


Link to post
Share on other sites

Good explanation.

What is AG short for? Not sure what to look at tweaking next to fine tune the effect.

Share this post


Link to post
Share on other sites
13 minutes ago, mole_man said:

Good explanation.

What is AG short for? Not sure what to look at tweaking next to fine tune the effect.

AG = autogen 

Autogen Lighting ( window/door lights )

Object lights ( brightness of the buildings and trees  —> as you darken terrain and AG lights , you also should darken the buildings .....


13900 8 cores @ 5.5-5.8 GHz / 8 cores @ 4.3 GHz (hyperthreading on) - Asus ROG Strix Gaming D4 - GSkill Ripjaws 2x 16 Gb 4266 mhz @ 3200 mhz / cas 13 -  Inno3D RTX4090 X3 iCHILL 24 Gb - 1x SSD M2 2800/1800 2TB - 1x SSD M2 2800/1800 1Tb - Sata 600 SSD 500 Mb - Thermaltake Level 10 GT case - EKWB Extreme 240 liquid cooling set push/pull - 2x 55’ Sony 4K tv's as front view and right view.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 1x 65” Sony 4K tv as left view.

FOV : 190 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Share this post


Link to post
Share on other sites

Autogen lighting is just for night lights I think, 'Autogen Emissive Lighting'? I like to keep them bright, but users could put same formulas into that section to darken nightlights with altitude.

Not tested in every season/TOD yet. Will end up with many presets through the year I expect, and probably different parts of the world do not see the ground go so dark with altitude as it does in Northern Europe/USA

How to vary the formula by season is the next challenge...

Share this post


Link to post
Share on other sites
On 11/13/2017 at 10:15 PM, GSalden said:

Here an example of how to lower terrain lighting when going higher :

1.0 - ( cb_altitude / 13000 * 0.2 )

On ground level you have a terrain brightness of 1.0

Up to 13000 m it is lowered gradually till it is 0.2 lower ( so 0.8 ).

At 6500 m : 1.0 - ( 6500 / 13000 * 0.2 )  =  1.0 - ( 0.5 * 0.2 ) = 1.0 - ( 0.1 ) = 0.9

 

regards, Gerard

 

Hi Gerard, 

What would be the line if i wanted the brightness to go up with the altitude ? i want to do this for the urban area lightning brightness. 

 

Thank you as usual !  


Roi Ben

Share this post


Link to post
Share on other sites

1.0 + ( cb_altitude / 13000 * 0.2 )

1.0 is your starting point

At 13.000 m it is : 1.0 + ( 1 * 0.2 ) = 1.2


  • Upvote 1

13900 8 cores @ 5.5-5.8 GHz / 8 cores @ 4.3 GHz (hyperthreading on) - Asus ROG Strix Gaming D4 - GSkill Ripjaws 2x 16 Gb 4266 mhz @ 3200 mhz / cas 13 -  Inno3D RTX4090 X3 iCHILL 24 Gb - 1x SSD M2 2800/1800 2TB - 1x SSD M2 2800/1800 1Tb - Sata 600 SSD 500 Mb - Thermaltake Level 10 GT case - EKWB Extreme 240 liquid cooling set push/pull - 2x 55’ Sony 4K tv's as front view and right view.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 1x 65” Sony 4K tv as left view.

FOV : 190 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Share this post


Link to post
Share on other sites
2 minutes ago, GSalden said:

1.0 + ( cb_altitude / 13000 * 0.2 )

1.0 is your starting point

At 13.000 m it is : 1.0 + ( 1 * 0.2 ) = 1.2

 

Thanks a lot Gerard ! 


Roi Ben

Share this post


Link to post
Share on other sites
3 hours ago, GSalden said:

1.0 + ( cb_altitude / 13000 * 0.2 )

1.0 is your starting point

At 13.000 m it is : 1.0 + ( 1 * 0.2 ) = 1.2

 

Some wrong parameter message when trying to put it there. Got it was missing -()


Roi Ben

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...