Pixelate 3D Effect

Shader that creates a pixelation effect.

Shader code
shader_type canvas_item;

uniform float Pixel_Size : hint_range(1.0, 32.0) = 8.0;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture;

void fragment() {
    vec2 screen_res = vec2(1.0) / SCREEN_PIXEL_SIZE; 
    vec2 uv = SCREEN_UV;

    uv = floor(uv * screen_res / Pixel_Size) * Pixel_Size / screen_res;

    COLOR = texture(SCREEN_TEXTURE, uv);
}
Tags
pixelate
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 AivanWorld

Screen Warping

Layer SplatMap

Noise & Grain

Related shaders

Pixelate Screen Effect

Scratch pixelate effect

pixelate to bulged grid

guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
YellowFrogGames
YellowFrogGames
1 month ago

Perfect, no nonsense and just works. Pixelates everything on the screen like expected 🙂

Last edited 1 month ago by YellowFrogGames