mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-22 15:51:30 +11:00
prevent rounding errors caused by floor()
This commit is contained in:
parent
8cea816700
commit
79c95a5036
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue