โ† All examples

godot shaders

Toon shading in bands with a rim light

Cel-shade a lit mesh in a chosen number of flat light bands with tinted shadows and add a view-dependent rim that is stronger on the lit side. Use for stylized characters, props and toy-like scenes.

Recorded render of Toon shading in bands with a rim light

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • demo.tscn
  • inspect_shader.py
  • material.tres
  • preview.png
  • test_package.py
  • toon_band_rim.gdshader
  • verification/native.json

How it works

Shader type
spatial
Parameters
base_color (vec4 = 0.32, 0.55, 0.85, 1), shadow_tint (vec4 = 0.18, 0.16, 0.36, 1), bands (int = 3), band_softness (float = 0.04), rim_color (vec4 = 1, 0.93, 0.78, 1), rim_width (float = 0.32), rim_strength (float = 1.4), rim_light_bias (float = 0.65)
Result
A mesh lit in flat colour bands with tinted shadows and a bright edge toward the light.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/toon_band_rim/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • contract_static
  • engine_run
  • engine_log_clean
  • shader_in_scene
  • capture_written
  • render_not_uniform
  • shader_changes_pixels

Limits to consider

Stylized and not physically based. Each light adds its own bands, so several lights stack into extra steps. Ambient light from the environment is added unbanded. Band edges alias at grazing angles without multisample anti-aliasing.