From 79c95a5036af4a38138dc8f924445a168eee4e54 Mon Sep 17 00:00:00 2001 From: hizzlekizzle Date: Tue, 28 May 2019 10:48:18 -0500 Subject: [PATCH] prevent rounding errors caused by floor() --- anti-aliasing/shaders/aa-shader-4.0.slang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anti-aliasing/shaders/aa-shader-4.0.slang b/anti-aliasing/shaders/aa-shader-4.0.slang index 4514c4c..8f25d3f 100644 --- a/anti-aliasing/shaders/aa-shader-4.0.slang +++ b/anti-aliasing/shaders/aa-shader-4.0.slang @@ -64,7 +64,7 @@ void main() vec2 g1 = vec2(inv_size.x,inv_size.y); vec2 g2 = vec2(-inv_size.x,inv_size.y); - vec2 pC4 = floor(OGL2Pos) * inv_size; + vec2 pC4 = floor(OGL2Pos) * 1.0001 * inv_size; // Reading the texels vec3 C1 = texture2d_(Source, pC4 - dy, yx); @@ -99,4 +99,4 @@ void main() vec3 c11 = 0.5*((dr*fp.x+dl*(1-fp.x))*fp.y+(ur*fp.x+ul*(1-fp.x))*(1-fp.y) ); FragColor = vec4(c11, 1.0); -} \ No newline at end of file +}