Palette Filter and Pixelate combined

This is just two shaders combined, resulting in the background in my pic.


Here are the projects separately




Shader code
shader_type canvas_item;

uniform bool flip ;
uniform sampler2D gradient : hint_black; // It can be whatever palette you want
uniform int amount = 40;

void fragment(){ 
	vec2 grid_uv = round(UV * float(amount)) / float(amount);
	vec4 col = texture(TEXTURE,grid_uv);
	float lum = dot(col.rgb,vec3(0.2126,0.7152,0.0722)); // luminance
	col = texture(gradient,vec2(abs(float(flip) - lum),0));
	COLOR = col;
Color, gradient, old, palette, pixel, retro
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

Palette Filter For 3D and 2D

Earthbound-like battle background shader w/scroll effect and palette cycling



Inline Feedbacks
View all comments