Ensure that gl_FragColor.rgb is always properly initialized in final.fsh

Not sure if debug_WATERSIM works as intended.
This commit is contained in:
rrtt217
2025-11-09 13:13:33 +08:00
parent d561c40ecf
commit 8375174cb5
+3 -3
View File
@@ -215,9 +215,11 @@ void main() {
COLOR = imageLoad(cloudDepthTex, ivec2(gl_FragCoord.xy*VL_RENDER_RESOLUTION*RENDER_SCALE)).rgb;
#endif
gl_FragColor.rgb = COLOR;
#if DEBUG_VIEW == debug_WATERSIM && WATER_INTERACTION == 2
if (hideGUI == 1) {
gl_FragColor.rgb = vec3(imageLoad(waveSim2, ivec2(gl_FragCoord.xy)*16).x);
gl_FragColor.rgb += vec3(imageLoad(waveSim2, ivec2(gl_FragCoord.xy)*16).x);
vec2 offsetCoords = vec2(gl_FragCoord.x-840.0, gl_FragCoord.y);
vec2 waveGradients = vec2(imageLoad(waveSim2, ivec2(offsetCoords)*16).zw);
@@ -225,6 +227,4 @@ void main() {
if (length(waveNormals.xy) > 0.0) gl_FragColor.rgb += waveNormals;
}
#endif
gl_FragColor.rgb += COLOR;
}