Skip to content

Commit a96dca3

Browse files
authored
FF7: Fixed fog rendering not working in underwater worldmap (#639)
1 parent ae19a87 commit a96dca3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

misc/FFNx.frag

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ void main()
291291

292292
if (isTimeFilterEnabled) color.rgb *= TimeColor.rgb;
293293

294-
if (isTLVertex && isFogEnabled) color.rgb = ApplyWorldFog(color.rgb, v_position0.xyz);
294+
if (!(isTLVertex) && isFogEnabled) color.rgb = ApplyWorldFog(color.rgb, v_position0.xyz);
295295

296296
// return to gamma space so we can do alpha blending the same way FF7/8 did.
297297
color.rgb = toGamma(color.rgb);

misc/FFNx.lighting.frag

+2-2
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,6 @@ void main()
376376
indirectLuminance = CalcConstIndirectLuminance(color.rgb);
377377
}
378378

379-
if (isFogEnabled) color.rgb = ApplyWorldFog(color.rgb, v_position0.xyz);
380-
381379
if(debugOutput == DEBUG_OUTPUT_COLOR)
382380
{
383381
gl_FragColor = color;
@@ -414,6 +412,8 @@ void main()
414412
{
415413
gl_FragColor = vec4(luminance + indirectLuminance, color.a);
416414
}
415+
416+
if (isFogEnabled && debugOutput == DEBUG_OUTPUT_DISABLED ) gl_FragColor.rgb = ApplyWorldFog(gl_FragColor.rgb, v_position0.xyz);
417417
}
418418

419419
if(!(isTLVertex) && gameLightingMode == GAME_LIGHTING_PER_PIXEL && debugOutput == DEBUG_OUTPUT_DISABLED)

0 commit comments

Comments
 (0)