Pixelize

Pixelizes a texture to the given resolution

Uniforms:
Resolution: The resolution to be scaled down to

Note:
I am trying to get a screen-reading version working as I think that would have more use

Shader code
shader_type canvas_item;

// --- Uniforms --- //
uniform float resolution: hint_range(0.0, 128.0, 1.0) = 32.0;

// --- Functions --- //
void fragment() {
	COLOR = texture(TEXTURE, round(UV * (resolution + 1.0) - (UV - 0.5)) / (resolution + 1.0));
}
Tags
downscale, pixel, pixel-art, pixelize
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.

More from KingToot

Linear Rainbow

Sine Morphing

Panning

Related shaders

Pixelize / Mosaic (overlay)

3D Transparent Walls (smooth edge or pixelize edge)

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
BananaBoy
10 months ago

when I paste the shader code, godot close

Last edited 10 months ago by BananaBoy