I followed a tutorial to create a shader in 3d, but i've tried to convert it to 2d so it fits with the rest of my shaders.
Instead of pixelating the image, its instead drawing these grid lines and i'm not sure why.
Any help fixing this would be appreciated.
Heres the shader.
shader_type canvas_item;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
const int pixel_size = 25;
void fragment() {
float x = float(int(FRAGCOORD.x) % pixel_size);
float y = float(int(FRAGCOORD.y) % pixel_size);
x = FRAGCOORD.x + floor(float(pixel_size) / 2.0) - x;
y = FRAGCOORD.y + floor(float(pixel_size) / 2.0) - y;
vec3 tex_color = texture(SCREEN_TEXTURE, vec2(x, y)).xyz;
COLOR = vec4(tex_color, 1);
}
