0 votes

Those of you who know about shaders, how can I modify the following simple pixellation screen shader to limit the color range? It creates a 'mosaic' effect , which is somewhat what I want, but because it doesn't limit the colors, the final effect is just basically low res but without the retro feel. I think if this was combined with a cap on colors and higher saturation, it would be fine. I'm trying to replicate the Ex Zodiac look.

shader_type canvas_item;

uniform float size_x = 0.008;
uniform float size_y = 0.008;

void fragment() {
    vec2 uv = SCREEN_UV;
    uv -= mod(uv, vec2(size_x, size_y));

COLOR.rgb = textureLod(SCREEN_TEXTURE, uv, 0.0).rgb;

}

THis here https://twitter.com/BcubedLabs/status/1077345409104670720 is exactly what I'm going for.

in Engine by (464 points)

From what I can guess, the depth of the color range needs to be limited, e.g. uses only 8-bits. Unfortunately, I can't figure out how to limit it.

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 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 webmaster@godotengine.org with your username.