0 votes

Hey,
I am currently using the pixalize shader from the 2d screen space shader demo:
https://godotengine.org/asset-library/asset/122

I additionally want to have only 16 or 8 bit colors, but I have no idea how to do this, but I suspect this would only be a few lines of additional shader code.

shader_type canvas_item;
uniform float size_x = 0.006;
uniform float size_y = 0.006;
void fragment() {
    vec2 uv = SCREEN_UV;
    uv -= mod(uv, vec2(size_x, size_y));
    COLOR.rgb = textureLod(SCREEN_TEXTURE, uv, 0.0).rgb;
}

Can someone help me out?

in Engine by (196 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.