Input Simplifier

Simplifies the input
It reduces the resolution and color

Has 2 parameters for how much color is allowed how how much bigger each pixel should be
For Pixel Size I recommend a whole number since using decimals cause a weird grid to appear

Shader code
shader_type canvas_item;

uniform float pixel_size : hint_range(1.0,50.0) = 4.0;
uniform int color_depth : hint_range(1,256) = 5;

void fragment()
{
	vec2 resolution = 1.0 / SCREEN_PIXEL_SIZE;
	vec2 pixCoord = FRAGCOORD.xy;
	vec2 uv = floor(pixCoord/pixel_size)/floor(resolution/pixel_size);
	vec4 input = texture(SCREEN_TEXTURE, uv);
	vec4 img = vec4(floor(input.r*float(color_depth))/float(color_depth), floor(input.g*float(color_depth))/float(color_depth), floor(input.b*float(color_depth))/float(color_depth), input.a);
	COLOR = img;
}
Tags
Color, pixel, reduction, simple
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

Input / Ouput

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments