Fix fog to draw Fog Cutoff Distance via a plane, not sphere test

Add support for negative Fog Cutoff Distance on fog to draw it in front of the camera Far Plane, no matter the setup.
Fix hot-reloading Fog shader in Editor.
This commit is contained in:
Wojtek Figat
2025-06-29 20:02:24 +02:00
parent dbd8297612
commit 4e4d380267
7 changed files with 39 additions and 47 deletions

View File

@@ -145,7 +145,7 @@ void PS_Forward(
#if USE_FOG
// Calculate exponential height fog
float4 fog = GetExponentialHeightFog(ExponentialHeightFog, materialInput.WorldPosition, ViewPos, 0);
float4 fog = GetExponentialHeightFog(ExponentialHeightFog, materialInput.WorldPosition, ViewPos, 0, gBuffer.ViewPos.z);
// Apply fog to the output color
#if MATERIAL_BLEND == MATERIAL_BLEND_OPAQUE