diff --git a/shaders/src/post_process.fs b/shaders/src/post_process.fs index 23d5493c69..1bc90b7a3d 100644 --- a/shaders/src/post_process.fs +++ b/shaders/src/post_process.fs @@ -50,6 +50,8 @@ vec4 PostProcess_AntiAliasing() { // Next, compute the coordinates of the texel center and its bounding box. There is no need to // clamp the min corner since the wrap mode will do it automatically. + + // vertex_uv is already interpolated to pixel center by the GPU HIGHP vec2 texelCenter = min(vertex_uv, upperBound); HIGHP vec2 texelMaxCorner = min(vertex_uv + halfTexel, upperBound); HIGHP vec2 texelMinCorner = vertex_uv - halfTexel; diff --git a/shaders/src/post_process.vs b/shaders/src/post_process.vs index 110bebcc75..38449f30d5 100644 --- a/shaders/src/post_process.vs +++ b/shaders/src/post_process.vs @@ -17,10 +17,8 @@ void main() { #endif #if POST_PROCESS_ANTI_ALIASING - // Account for the texture actual size - vertex_uv *= postProcessUniforms.uvScale; - // Compute texel center - vertex_uv = (floor(vertex_uv) + vec2(0.5, 0.5)) * frameUniforms.resolution.zw; + // texel to uv, accounting for the texture actual size + vertex_uv *= frameUniforms.resolution.zw * postProcessUniforms.uvScale; #endif gl_Position = position;