Pixelation with nearest-colour palette mapping
In your harnessGodot shaderMIT
Pixelate the screen into blocks and snap each block to the nearest colour of a small palette texture, with optional ordered dithering between palette colours, for low-resolution retro looks.

What it takes and gives
- Shader type
- spatial
- Render modes
- unshaded, cull_disabled, depth_test_disabled, depth_draw_never, skip_vertex_transform, fog_disabled
- Parameters
- screen_texture (sampler2D), palette (sampler2D), palette_size (int = 8), pixel_size (float = 4), dither_strength (float = 0.35), palette_mix (float = 1)
- Use it on
- A MeshInstance3D with a 2 x 2 QuadMesh,
material.tresas its material override and a large extra cull margin, as indemo.tscn., Optional: a palette image (N colours side by side) forpalette. - Result
- The scene as chunky 4-pixel blocks reduced to an eight-colour retro palette.
- Renderers
- compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
- Placement
- res://baltor/godot_shaders/post_pixelate_palette/
Limits. Blocks sample one point, so thin details can vanish between frames as the camera moves. Palette matching is a weighted RGB distance, not a perceptual colour space. Cost grows with palette_size. The pass reads Godot's screen texture after opaque geometry, so transparent objects drawn after it are not processed and its order among other transparent passes is not controlled.
Details
- Kind
- Godot shader
- Engine
- Godot 4.3 or later
- Files
- 11 files, 53.5 KB
- Licence
- MIT
- Declared effects
- reads files, runs commands
- Checked with
- Godot 4.7.2, opengl3 compatibility (Mesa llvmpipe, Xvfb)
- Checks
- contract static, engine run, engine log clean, shader in scene, capture written, render not uniform, shader changes pixels
- Techniques
- Block pixelation by sampling block centres, Nearest palette colour search, 2 x 2 ordered dithering
- Tags
- godot shader, spatial, post-process, pixel art, pixelate, palette, retro, full-screen
- Identity
library.supply.creative_originals.886720fccbad4b383e090a04.68ca553fa337a2ef- Version
68ca553fa337a2efcca6394a9a648ce177b8673749a2d65e899b49bb33f8094b
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.


