Jump to content
Sign in to follow this  
roi1862

Haze value formula help.

Recommended Posts

Hi guys, 

Who is talented enough to help untalented guy like me ?  

Heres the thing : i have a value set in the haze tweak and its perfect for day time plus i unticked the density depends on altitude so it create me nice haze at high altitude.

The only thing i want is that during night time the haze effect will be off or at the minimum density as possible. 

Who can help me prepare some formula that will do it ? 

 

Thank you !!


Roi Ben

Share this post


Link to post
Share on other sites

I cant get this

Example 1. I don't like it when very thick fog covers the sunset & sky. The first solution is to put a number in the "Sky fog tuning" tweak parameter (0.1, for example). In this case the fog will be reduced, not just during sunrise/sunset, for for the whole day. The second solution is take into account sunlight power as a tweak parameter.

For example, I want the fog influence to stay at it's default value (1.00) at noon and smoothly decrease down to 0.1 at dusk (when sunlight power becomes less than 0.3 as an example). I can use the green component of sunlight as a sunlight power and try linear interpolation expression like this:

Fog influence = 0.1+(SunPower-0)/(0.3-0)*(1-0.1) or

Fog influence = saturate(0.1 + cb_mSun.mDiffuse.g/0.33)

Here cb_mSun.mDiffuse.g is sun power (in the afternoon it's strong and equals ~0.9, at night = 0), saturate function that clamps value in to [0..1]. Don't forget to put whole expression in a parenthesis in Fog influence parameter editor:

(saturate(0.1 + cb_mLights[SUN_LIGHT].mDiffuse.g/0.33)) will be a final expression for "Sky fog tuning" tweak parameter.

 

i guess thats what i am trying to achieve more or less but cant see it coming together...


Roi Ben

Share this post


Link to post
Share on other sites

Instead of the fixed value you write :

saturate(0.1 + cb_mSun.mDiffuse.g/0.33)

in the text window.

Now you have 1.0 during the day and when the power of the sun becomes lower than 33% of its daytime power the Fog becomes slowly less till 0.1.

If 0.1 is too low you can increase it to your liking.

 

After having Saved your new Preset, first reinstall the Default Shaders and then Apply your preset.

In P3Dv4.5 in the menu ( Controls ) you choose Reload Shaders and within 15 sec you will see your result. 

No need the restart P3Dv4.5.

 

  • Like 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
10 hours ago, GSalden said:

Instead of the fixed value you write :

saturate(0.1 + cb_mSun.mDiffuse.g/0.33)

in the text window.

Now you have 1.0 during the day and when the power of the sun becomes lower than 33% of its daytime power the Fog becomes slowly less till 0.1.

If 0.1 is too low you can increase it to your liking.

 

After having Saved your new Preset, first reinstall the Default Shaders and then Apply your preset.

In P3Dv4.5 in the menu ( Controls ) you choose Reload Shaders and within 15 sec you will see your result. 

No need the restart P3Dv4.5.

 

Thank you very much ! As usual youre the pro 🙂

Just one thing, i need this for the haze effect density value which in my case is 0.00000110 and i would like this to be like 0.0000001 at night. So can your example still be vaild at this scenario? 

 

Thanks again

Edited by roi1862

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...