Skip to content

Commit bfd65a9

Browse files
committed
Clip mosaic effect to logical bounds too
1 parent 589ded1 commit bfd65a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/shaders/sprite.frag

+7-2
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,14 @@ void main()
168168

169169
gl_FragColor = texture2D(u_skin, texcoord0);
170170

171-
#ifdef ENABLE_pixelate
171+
#if defined(ENABLE_pixelate) || defined(ENABLE_mosaic)
172172
// Ensure that the pixels don't extend outside the "logical bounds"
173-
gl_FragColor *= float(v_logicalCoord.x <= 1.0 && v_logicalCoord.y <= 1.0);
173+
gl_FragColor *= float(
174+
v_logicalCoord.x >= 0.0 &&
175+
v_logicalCoord.y >= 0.0 &&
176+
v_logicalCoord.x <= 1.0 &&
177+
v_logicalCoord.y <= 1.0
178+
);
174179
#endif
175180

176181
#if defined(ENABLE_color) || defined(ENABLE_brightness)

0 commit comments

Comments
 (0)