Lighting through an artist colour ramp
In your harnessGodot shaderMIT
Map the light term through a gradient texture so an artist controls the whole shading curve and its colours: warm lights, coloured shadows, sharp or soft transitions, plus a ramp-driven specular and rim.

What it takes and gives
- Shader type
- spatial
- Parameters
- light_ramp (sampler2D), albedo (vec4 = 1, 1, 1, 1), ramp_offset (float = 0), specular_size (float = 0.12), specular_strength (float = 0.6), rim_amount (float = 0.3), rim_width (float = 0.25)
- Use it on
- A ramp texture; edit the bundled GradientTexture1D or assign any horizontal gradient image.
- Result
- Shapes shaded from purple shadows through an orange edge to warm white light.
- Renderers
- compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
- Placement
- res://baltor/godot_shaders/ramp_texture_lighting/
Limits. Each light samples the ramp separately and adds, so several lights brighten past the ramp. Ambient light does not use the ramp. A ramp with sharp steps aliases at grazing angles.
Details
- Kind
- Godot shader
- Engine
- Godot 4.3 or later
- Files
- 11 files, 57.0 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
- Ramp texture lighting (lookup of the half-Lambert term), Hard step specular, Ramp-tinted rim
- Tags
- godot shader, spatial, ramp shading, toon, gradient, stylized, custom light function
- Identity
library.supply.creative_originals.18ebf22ff82b9bdaac7cd646.0160cb268fbce602- Version
0160cb268fbce602eef8aab4c28fc234f493863cf0e719e4c3fad0e2ba20e648
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.

