Jump to content

Haze intensity fix for P3Dv5.3 HF2 (non-EA)


Recommended Posts

Posted

I modded the shaders in P3Dv5.3 HF2 to lower the haze density/Rayleigh scattering, as it's far too dense.  This is only for folks running with EA off--it won't have any effect if you are using EA.

First make a backup copy of, and then open this file with a text editor:  <your root P3Dv5 folder>\ShadersHLSL\FuncLibrary.fxh

In the vicinity of line 504, find and replace this text:

#if !defined(SHD_ENHANCED_ATMOSPHERICS_BLEND) && !defined(SHD_TO_FAR_CLIP) && !defined(SHD_SKY_STARS)
    const float distanceFogTrans = min(transmittance, CalculateExponentialFogBlend(distanceSq, cb_View.mFogDensity));
    fogInscatter += cb_View.mFogColor.rgb * distanceFogTrans;
    transmittance = saturate(transmittance - distanceFogTrans);
#endif
    return float4(fogInscatter, transmittance);


with this text

#if !defined(SHD_ENHANCED_ATMOSPHERICS_BLEND) && !defined(SHD_TO_FAR_CLIP)
    const float haze_scalar = 0.8f;  //recommend values of 0.65 to 0.85
    const float distanceFogTrans = min(transmittance, CalculateExponentialFogBlend(distanceSq, (cb_View.mFogDensity * haze_scalar)));
    fogInscatter += cb_View.mFogColor.rgb * distanceFogTrans;
    transmittance = saturate(transmittance - distanceFogTrans);
#endif
    return float4(fogInscatter, transmittance);

 

A higher value of haze_scalar makes the haze thicker, a lower value fades it.  I've settled on 0.8 here.

Once you've made the changes, you'll need to clear your shader cache before running P3D in order to effect the change.

 

Bob Scott | President and CEO, AVSIM Inc
ATP Gulfstream II-III-IV-V

System1 (P3Dv5/v4): i9-13900KS, water 2x360mm, ASUS Z790 Hero, 32GB GSkill 7800MHz CAS36, ASUS RTX4090
Samsung 55" JS8500 4K TV@60Hz,
3x 2TB WD SN850X 1x 4TB Crucial P3 M.2 NVME SSD, EVGA 1600T2 PSU, 1.2Gbps internet
Fiber link to Yamaha RX-V467 Home Theater Receiver, Polk/Klipsch 6" bookshelf speakers, Polk 12" subwoofer, 12.9" iPad Pro
PFC yoke/throttle quad/pedals with custom Hall sensor retrofit, Thermaltake View 71 case, Stream Deck XL button box

Sys2 (MSFS/XPlane12-11): AMD 7800X3D, water 2x240mm, MSI MPG X670E Carbon, 64GB GSkill 6000/30, nVidia RTX4090FE
Alienware AW3821DW 38" 21:9 GSync, 2x4TB Crucial T705 PCIe5 + 2x2TB Samsung 990 SSD, EVGA 1000P2 PSU, 12.9" iPad Pro
Thrustmaster TCA Boeing Yoke, TCA Airbus Sidestick, Twin TCA Airbus Throttle quads, PFC Cirrus Pedals, Coolermaster HAF932 case

Portable Sys3 (P3Dv4/FSX/DCS): i9-9900K @ 5.0 Ghz, Noctua NH-D15, 32GB 3200/16, EVGA RTX3090, Dell S2417DG 24" GSync
Corsair RM850x PSU, TM TCA Officer Pack, Saitek combat pedals, TM Warthog HOTAS, Coolermaster HAF XB case

  • Moderator
Posted

Bob, you're a star man! 👏 Having made the mod I no longer have than annoying banding when at altitude.

Thanks very much for identifying the problem and coming up with the fix. It makes you wonder why LM never came up with a fix given a lot of people must not use EA.

Ray (Cheshire, England).

System: P3D v5.3HF2, Intel i9-13900K, MSI 4090 GAMING X TRIO 24G, Crucial T700 4Tb M.2 SSD, Asus ROG Maximus Z790 Hero, 32Gb Corsair Vengeance DDR5 6000Mhz RAM, Win 11 Pro 64-bit, BenQ PD3200U 32” UHD monitor, Fulcrum One yoke, Fulcrum TQ (pre-production).

Cheadle Hulme Weather website.

chlive.php

Posted

I tried this edit, and I'm pretty pleased with it.  It really does make the cloud renditions so much better if you're using the sim without EA.  Sometimes I do change to a non-EA environment because the cockpits are brighter and the world is a bit brighter too.

Stan

Posted
On 12/24/2022 at 3:33 PM, Butch1 said:

I tried this suggestion and it does make a difference with EA off. I didn't know how to clear the shaders folder but rather ask (bother) anyone here I googled it (google is sometimes your friend) Poppet explains where the shaders folder is and how to clear them.

 https://www.avsim.com/forums/topic/479630-where-to-find-my-shaders-folder-prepar3d-v2-v3-v4/

Also shown in Youtube:

https://www.youtube.com/watch?v=xJo5gWCw3is&t=1s

 

 

On 12/24/2022 at 3:33 PM, Butch1 said:

 

 

 

Posted

Does this work with Envshade or RDShade?

Gigabyte x670 Aorus Elite AX MB; AMD 7800X3D CPU; Deepcool LT520 AIO Cooler; 64 Gb G.Skill Trident Z5 NEO DDR5 6000; Win11 Pro; P3D V5.4; 1 Samsung 990 2Tb NVMe SSD: 1 Crucial 4Tb MX500 SATA SSD; 1 Samsung 860 1Tb SSD; Gigabyte Aorus Extreme 1080ti 11Gb VRAM; Toshiba 43" LED TV @ 4k; Honeycomb Bravo.

 

  • 2 months later...
  • 2 months later...
Posted
On 12/23/2022 at 4:22 PM, spilok said:

I tried this edit, and I'm pretty pleased with it.  It really does make the cloud renditions so much better if you're using the sim without EA.  Sometimes I do change to a non-EA environment because the cockpits are brighter and the world is a bit brighter too.

Stan

Stan - go to NVIDIA settings > change resolution >output dynamic range > set to limited.

Dynamic range set to full.

In my case that brightens whole sim in EA mode.

Artur 

Posted
4 hours ago, Beardyman said:

Stan - go to NVIDIA settings > change resolution >output dynamic range > set to limited.

Dynamic range set to full.

In my case that brightens whole sim in EA mode.

Thanks.  I'll check it out

Archived

This topic is now archived and is closed to further replies.

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