Skip to content

Commit

Permalink
FF7: Fixed fog rendering not working in underwater worldmap (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmosXIII committed Jan 14, 2024
1 parent ae19a87 commit a96dca3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion misc/FFNx.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions misc/FFNx.lighting.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a96dca3

Please sign in to comment.