Skip to content

Commit 670425e

Browse files
committed
UPBGE: Fix frame buffer copy shader.
Do not mix usage of gl_FragData and gl_FragColor. The frame buffer shader now only uses gl_FragData for the first slot, others slots are ignored as they are never used after the frame buffer is copied, filters use the original frame buffer (or the one blitted) which contains all the slots. Fix issue: #969.
1 parent 2318393 commit 670425e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/blender/gpu/shaders/gpu_shader_frame_buffer_frag.glsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ void main()
3838
if (stippleid == STIPPLE_ROW) {
3939
int result = int(mod(gl_FragCoord.y, 2));
4040
if (result != 0) {
41-
gl_FragColor = texture2D(lefteyetex, co);
41+
gl_FragData[0] = texture2D(lefteyetex, co);
4242
}
4343
else {
44-
gl_FragColor = texture2D(righteyetex, co);
44+
gl_FragData[0] = texture2D(righteyetex, co);
4545
}
4646
}
4747
else if (stippleid == STIPPLE_COLUMN) {
4848
int result = int(mod(gl_FragCoord.x, 2));
4949
if (result == 0) {
50-
gl_FragColor = texture2D(lefteyetex, co);
50+
gl_FragData[0] = texture2D(lefteyetex, co);
5151
}
5252
else {
53-
gl_FragColor = texture2D(righteyetex, co);
53+
gl_FragData[0] = texture2D(righteyetex, co);
5454
}
5555
}
5656
#elif defined(ANAGLYPH)
@@ -63,6 +63,6 @@ void main()
6363
#endif
6464

6565
#ifdef COLOR_MANAGEMENT
66-
linearrgb_to_srgb(gl_FragColor, gl_FragColor);
66+
linearrgb_to_srgb(gl_FragData[0], gl_FragData[0]);
6767
#endif
6868
}

0 commit comments

Comments
 (0)