Baltor Get started

Gallery / Godot shaders

Low-poly flat shading with per-facet colour

In your harnessGodot shaderMIT

Give any mesh a faceted low-poly look: per-pixel face normals from screen derivatives, per-facet colour variation from a hash of the face normal, a height gradient, and optional vertex jitter to break up regular primitives.

Render of Low-poly flat shading with per-facet colour
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Shader type
spatial
Parameters
low_color (vec4 = 0.18, 0.42, 0.3, 1), high_color (vec4 = 0.85, 0.82, 0.55, 1), gradient_bottom (float = -0.6), gradient_top (float = 0.6), facet_variation (float = 0.12), jitter (float = 0.06), roughness (float = 0.9)
Result
A faceted sphere with visibly flat triangles shaded in greens fading to sand at the top.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/low_poly_flat_shading/

Limits. Derivative normals are per 2 x 2 pixel block, so tiny triangles get noisy normals. Jitter moves vertices by a hash of their quantized position: vertices closer than 1/50 object unit can merge their offsets. Shadows use the jittered shape.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 55.7 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
Face normals from screen-space derivatives (cross of dFdx and dFdy), Hashed per-facet colour variation, Position-hashed vertex jitter, MurmurHash3 32-bit finalizer over prime-combined lattice coordinates as a hash
Tags
godot shader, spatial, low poly, flat shading, faceted, stylized, derivatives
Identity
library.supply.creative_originals.f6fb7e7bf1bc2d1d5e6cba02.0241c042dca70acf
Version
0241c042dca70acfbbef650e08af0b27079c1efb850ac2633d3ad7c219daa23f

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.