P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Any issues, problems or troubleshooting topics related to the Prepar3D client application.
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by Beau Hollis »

Thanks for testing that out and providing feedback. I think this will work better:

Code: Select all

    float zBiasOverride = ZBias;
    if (ZBias < 0) zBiasOverride = -1 + ZBias * 0.03333333;
    vProj[2][2] += zBiasOverride * 4.76837158e-7;
This will scale all z-bias values (currently ranging from -1 to -30) into values between -1 and -2 while keeping all the object/layer ordering preserved. If you're seeing z-fighting, you could try increasing the value 0.03333333. I tested this briefly and didn't see z-fighting of the runways/aprons. If you do see issue with runways, aprons, etc, you could try bumping the base value (-1) up a bit.
Beau Hollis
Prepar3D Software Architect
MPO910
Posts: 855
Joined: Wed Apr 15, 2020 5:00 am

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by MPO910 »

Thanks again!

I copied your "code" and will test now.

I will Report back tomorrow.

Regards
Marcus
Marcus P
Windows 10 Home 21H1
Build 19043.1586
Feature Exp. Pack 120.2212.4170.0
i9 10900K @ 5.0 Ghz | HT OFF | 1.32V
Mainboard ASUS ROG Maximus XII Formula Z490
32 GB RAM 3600 Mhz
RTX 3090 24GB
32" Samsung UHD Monitor
HP Reverb G2 VR HMD | Steam VR
MPO910
Posts: 855
Joined: Wed Apr 15, 2020 5:00 am

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by MPO910 »

Beau Hollis wrote: Mon Jan 11, 2021 6:31 pm Thanks for testing that out and providing feedback. I think this will work better:

Code: Select all

    float zBiasOverride = ZBias;
    if (ZBias < 0) zBiasOverride = -1 + ZBias * 0.03333333;
    vProj[2][2] += zBiasOverride * 4.76837158e-7;
This will scale all z-bias values (currently ranging from -1 to -30) into values between -1 and -2 while keeping all the object/layer ordering preserved. If you're seeing z-fighting, you could try increasing the value 0.03333333. I tested this briefly and didn't see z-fighting of the runways/aprons. If you do see issue with runways, aprons, etc, you could try bumping the base value (-1) up a bit.
Good morning!

I did test the new values at default and addon airports/cityscapes and it seem to work perfectly well with exact those values!

This eliminates the objects shown through clouds/fog completely AND does not come with any side effects like disappearing 3dmodels, like airport buildings, apron, planes, etc.

Thanks a lot for helping me/us out.

It was great to see LM collaborate directly and found a quick "work around/solution" for this.

I/we can now enjoy the new EA mode much more, even within VR!

Thanks again and if there are further "things" to try/test, I will be happy to help out.

Marcus
Marcus P
Windows 10 Home 21H1
Build 19043.1586
Feature Exp. Pack 120.2212.4170.0
i9 10900K @ 5.0 Ghz | HT OFF | 1.32V
Mainboard ASUS ROG Maximus XII Formula Z490
32 GB RAM 3600 Mhz
RTX 3090 24GB
32" Samsung UHD Monitor
HP Reverb G2 VR HMD | Steam VR
hotbso
Posts: 28
Joined: Tue May 14, 2019 9:01 am

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by hotbso »

Thanx.
Perfect. EDDF: airport buildings still there, tops of high-risers above the mist, everything else hidden.
Image
MPO910
Posts: 855
Joined: Wed Apr 15, 2020 5:00 am

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by MPO910 »

hotbso wrote: Tue Jan 12, 2021 10:20 am Thanx.
Perfect. EDDF: airport buildings still there, tops of high-risers above the mist, everything else hidden.
Image
This way it looks great or?
I do really enjoy it much more now. As you saw already, even the tops of "MainHattan" as we say in Frankfurt (where I work and live near) are visible above the fog layer. This is really great.
Thanks for sharing!
Marcus
Marcus P
Windows 10 Home 21H1
Build 19043.1586
Feature Exp. Pack 120.2212.4170.0
i9 10900K @ 5.0 Ghz | HT OFF | 1.32V
Mainboard ASUS ROG Maximus XII Formula Z490
32 GB RAM 3600 Mhz
RTX 3090 24GB
32" Samsung UHD Monitor
HP Reverb G2 VR HMD | Steam VR
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by Beau Hollis »

Thanks all for testing this out and providing feedback. Here is an updated set of full instructions with the newest shader change:

1. Open P3DInstallDirectory\ShadersHLSL\FuncLibrary.fxh
2. Look for this around line 780:

Code: Select all

   vProj[2][2] += ZBias * 4.76837158e-7;
replace it with:

Code: Select all

    float zBiasOverride = ZBias;
    if (ZBias < 0) zBiasOverride = -1 + ZBias * 0.03333333;
    vProj[2][2] += zBiasOverride * 4.76837158e-7;
3. Clear cached shaders by deleting the Shaders folder here:
%LocalAppData%\Lockheed Martin\Prepar3D v5\Shaders
4. Re-launch p3d.
Beau Hollis
Prepar3D Software Architect
MPO910
Posts: 855
Joined: Wed Apr 15, 2020 5:00 am

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by MPO910 »

Beau Hollis wrote: Tue Jan 12, 2021 5:41 pm Thanks all for testing this out and providing feedback. Here is an updated set of full instructions with the newest shader change:

1. Open P3DInstallDirectory\ShadersHLSL\FuncLibrary.fxh
2. Look for this around line 780:
CODE: SELECT ALL

Code: Select all

   vProj[2][2] += ZBias * 4.76837158e-7;

replace it with:

Code: Select all

    float zBiasOverride = ZBias;
    if (ZBias < 0) zBiasOverride = -1 + ZBias * 0.03333333;
    vProj[2][2] += zBiasOverride * 4.76837158e-7;
3. Clear cached shaders by deleting the Shaders folder here:
%LocalAppData%\Lockheed Martin\Prepar3D v5\Shaders
4. Re-launch p3d.
Thanks for the update. This works flawlessly.
I have done some further test today. I did not noticed any further side effects.

Marcus
Marcus P
Windows 10 Home 21H1
Build 19043.1586
Feature Exp. Pack 120.2212.4170.0
i9 10900K @ 5.0 Ghz | HT OFF | 1.32V
Mainboard ASUS ROG Maximus XII Formula Z490
32 GB RAM 3600 Mhz
RTX 3090 24GB
32" Samsung UHD Monitor
HP Reverb G2 VR HMD | Steam VR
B777ER
Posts: 106
Joined: Sat May 14, 2016 2:45 pm

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by B777ER »

Beau Hollis wrote: Tue Jan 12, 2021 5:41 pm Thanks all for testing this out and providing feedback. Here is an updated set of full instructions with the newest shader change:

1. Open P3DInstallDirectory\ShadersHLSL\FuncLibrary.fxh
2. Look for this around line 780:

Code: Select all

   vProj[2][2] += ZBias * 4.76837158e-7;
replace it with:

Code: Select all

    float zBiasOverride = ZBias;
    if (ZBias < 0) zBiasOverride = -1 + ZBias * 0.03333333;
    vProj[2][2] += zBiasOverride * 4.76837158e-7;
3. Clear cached shaders by deleting the Shaders folder here:
%LocalAppData%\Lockheed Martin\Prepar3D v5\Shaders
4. Re-launch p3d.
Beau, will this be a change reflected in the next release which I'm assuming is 5.2? Also, for those using a 3rd party software like EnvShade, will this code need to be changed everytime we update our shader files?
MPO910
Posts: 855
Joined: Wed Apr 15, 2020 5:00 am

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by MPO910 »

B777ER wrote: Tue Jan 12, 2021 8:56 pm
Beau Hollis wrote: Tue Jan 12, 2021 5:41 pm Thanks all for testing this out and providing feedback. Here is an updated set of full instructions with the newest shader change:

1. Open P3DInstallDirectory\ShadersHLSL\FuncLibrary.fxh
2. Look for this around line 780:

Code: Select all

   vProj[2][2] += ZBias * 4.76837158e-7;
replace it with:

Code: Select all

    float zBiasOverride = ZBias;
    if (ZBias < 0) zBiasOverride = -1 + ZBias * 0.03333333;
    vProj[2][2] += zBiasOverride * 4.76837158e-7;
3. Clear cached shaders by deleting the Shaders folder here:
%LocalAppData%\Lockheed Martin\Prepar3D v5\Shaders
4. Re-launch p3d.
Beau, will this be a change reflected in the next release which I'm assuming is 5.2? Also, for those using a 3rd party software like EnvShade, will this code need to be changed every time we update our shader files?
Hello Eric,

allthough I am not Beau, I would like to point you to the feedback from LM regarding one of your 2 questions:
LM will MOST likely be able to fix this. Making promises would probably be early as this should be properly tested. Look here at the linked post from Beau Hollis:
https://www.prepar3d.com/forum/viewtopi ... 12#p234361

Regarding Envshade it is hard to tell if they will have to make changes. As Envshade does "modify" shaders, I do assume this will be necessary. Unfortunately this will always be necessary as soon default shader files, or even the core engine, changes things which will be used by Envshade to modify. Modifying shaders is always a risk which can lead to unintended CTDs, if something is not done right.

Personally I don´t like this approach. I prefer a stable platform by taking less risk.

This question you should probably parse to TOGA. TOGA will be able to answer this probably after the next release, as soon as they can take a look at the changes (I assume they are not part of LM BETA Team).

Hopefully this answers your questions, at least partially.

Marcus
Marcus P
Windows 10 Home 21H1
Build 19043.1586
Feature Exp. Pack 120.2212.4170.0
i9 10900K @ 5.0 Ghz | HT OFF | 1.32V
Mainboard ASUS ROG Maximus XII Formula Z490
32 GB RAM 3600 Mhz
RTX 3090 24GB
32" Samsung UHD Monitor
HP Reverb G2 VR HMD | Steam VR
hkhoanguyen
Posts: 46
Joined: Sat Feb 21, 2015 8:45 am

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by hkhoanguyen »

Hello Eric,/url]

This question you should probably parse to TOGA. TOGA will be able to answer this probably after the next release, as soon as they can take a look at the changes (I assume they are not part of LM BETA Team).
Marcus
TOGA dropped Envshade future update in the recent annoucement.
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by Beau Hollis »

Eric,

That change or something like it will likely be in the next release assuming no issues come up in beta. Once we're confident enough with that approach we may pre-calculate scaled zbias values in C++ to avoid doing the extra math in the shader. Pretty much every point release includes shader changes, so any shader modifying addons would need to be updated regardless. If a add-on contains it's own shaders for post process effects, those don't generally need updating.
Beau Hollis
Prepar3D Software Architect
MPO910
Posts: 855
Joined: Wed Apr 15, 2020 5:00 am

Re: P3D V5.1 latest Build, VR, EA and simobjects showing through clouds

Post by MPO910 »

Good day Beau!

I did at least 8 more long haul flights mainly above NA and EUR.
In addition 3 further short haul flights above EUR and Asia.
Further takeoffs and landings for test purposes.

I used default P3D and also Addons like ORBX Base, LC, Regions and TE products with and without 3th party airports (recent and older ones).
Also using the camera addon ChasePLane or default views did not influence this.

Tested this with several texture size settings and draw distances. With default weather and addon created weather via ASP3D or FSGRW.

I did not find one further side effect. I am confident that the values you delivered are good to use. Just a short feedback from my side.

Also I got your PM. Really appreciated it. Have a nice weekend!

Marcus
Marcus P
Windows 10 Home 21H1
Build 19043.1586
Feature Exp. Pack 120.2212.4170.0
i9 10900K @ 5.0 Ghz | HT OFF | 1.32V
Mainboard ASUS ROG Maximus XII Formula Z490
32 GB RAM 3600 Mhz
RTX 3090 24GB
32" Samsung UHD Monitor
HP Reverb G2 VR HMD | Steam VR
Post Reply