diff --git a/shaders/gles2/common.inc.glsl b/shaders/gles2/common.inc.glsl index 8283ce2b..a54bfd11 100644 --- a/shaders/gles2/common.inc.glsl +++ b/shaders/gles2/common.inc.glsl @@ -150,7 +150,6 @@ vec2 computeMCAASnappedPosition(vec2 position, position = transformVertexPositionST(position, localTransformST); position = transformVertexPositionST(position, globalTransformST); position = convertClipToScreenSpace(position, framebufferSize); - //position.x = abs(mod(position.x, 1.0)) < 0.5 ? floor(position.x) : ceil(position.x); float xNudge = fract(position.x); if (xNudge < 0.5) diff --git a/shaders/gles2/mcaa-multi.vs.glsl b/shaders/gles2/mcaa-multi.vs.glsl index b96d8af4..8e41a259 100644 --- a/shaders/gles2/mcaa-multi.vs.glsl +++ b/shaders/gles2/mcaa-multi.vs.glsl @@ -85,8 +85,11 @@ void main() { float depth = convertPathIndexToViewportDepthValue(pathID); + // Use the same side--in this case, the top--or else floating point error during partitioning + // can occasionally cause inconsistent rounding, resulting in cracks. vec2 position; - position.x = mix(tlPosition.x, brPosition.x, quadPosition.x); + position.x = quadPosition.x < 0.5 ? tlPosition.x : trPosition.x; + if (quadPosition.y < 0.5) position.y = floor(min(tlPosition.y, trPosition.y)); else