Hey gang! I'm using a greyscale mask on a shader to set the alpha value for a 2D canvas item. I have checked the mask PNG to make sure that all the colors are pixel perfect, and there are no anti-aliasing artifacts or anything there. However, when I go to render, godot creates artifacts that seem to result from interpolation from texture sampling. How do I fix this?
Here is the effect I'm seeing
EDIT: klaas has confirmed my suspicions about interpolation. For anyone ecnountering the same issue, here is a sample method to use texelFetch() from UV in lieu of texture:
texture:
float value = texture(mask, UV, 1).r;
texelFetch()
`
int texelX = int(UV.x * float(width) + float(offset_x) );
int texelY = int(UV.y * float(height) + float(offset_y) );
ivec2 texel = ivec2( texelX, texelY );
float value = texelFetch( mask, texel, 0).r;
`