prevent rounding errors caused by floor()

This commit is contained in:
hizzlekizzle 2019-05-28 10:48:18 -05:00 committed by GitHub
parent 8cea816700
commit 79c95a5036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,7 @@ void main()
vec2 g1 = vec2(inv_size.x,inv_size.y); vec2 g1 = vec2(inv_size.x,inv_size.y);
vec2 g2 = 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 // Reading the texels
vec3 C1 = texture2d_(Source, pC4 - dy, yx); 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) ); 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); FragColor = vec4(c11, 1.0);
} }