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

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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

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

Share this post


Link to post
Share on other sites
Posted (edited)
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now