From a96dca352f706282690467cdba8e74774ef4a988 Mon Sep 17 00:00:00 2001 From: CosmosXIII <82299148+CosmosXIII@users.noreply.github.com> Date: Sun, 14 Jan 2024 20:24:44 +0900 Subject: [PATCH] FF7: Fixed fog rendering not working in underwater worldmap (#639) --- misc/FFNx.frag | 2 +- misc/FFNx.lighting.frag | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/FFNx.frag b/misc/FFNx.frag index 5437b3ba..981f1506 100644 --- a/misc/FFNx.frag +++ b/misc/FFNx.frag @@ -291,7 +291,7 @@ void main() if (isTimeFilterEnabled) color.rgb *= TimeColor.rgb; - if (isTLVertex && isFogEnabled) color.rgb = ApplyWorldFog(color.rgb, v_position0.xyz); + if (!(isTLVertex) && isFogEnabled) color.rgb = ApplyWorldFog(color.rgb, v_position0.xyz); // return to gamma space so we can do alpha blending the same way FF7/8 did. color.rgb = toGamma(color.rgb); diff --git a/misc/FFNx.lighting.frag b/misc/FFNx.lighting.frag index 25e74b82..323949d9 100644 --- a/misc/FFNx.lighting.frag +++ b/misc/FFNx.lighting.frag @@ -376,8 +376,6 @@ void main() indirectLuminance = CalcConstIndirectLuminance(color.rgb); } - if (isFogEnabled) color.rgb = ApplyWorldFog(color.rgb, v_position0.xyz); - if(debugOutput == DEBUG_OUTPUT_COLOR) { gl_FragColor = color; @@ -414,6 +412,8 @@ void main() { gl_FragColor = vec4(luminance + indirectLuminance, color.a); } + + if (isFogEnabled && debugOutput == DEBUG_OUTPUT_DISABLED ) gl_FragColor.rgb = ApplyWorldFog(gl_FragColor.rgb, v_position0.xyz); } if(!(isTLVertex) && gameLightingMode == GAME_LIGHTING_PER_PIXEL && debugOutput == DEBUG_OUTPUT_DISABLED)