โ† All examples

godot shaders

Pen hatching driven by lighting

Pen-and-ink shading from scene lights: brighter areas stay paper, darker areas get one, two, three and four layers of hatching lines at different angles, aligned to the surface UVs so the strokes stick to the object.

Recorded render of Pen hatching driven by lighting

What this component contains

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

How it works

Shader type
spatial
Parameters
paper_color (vec4 = 0.96, 0.94, 0.88, 1), line_density (float = 90), line_width (float = 0.35), level_1 (float = 0.8), level_2 (float = 0.55), level_3 (float = 0.32), level_4 (float = 0.15), ink_strength (float = 0.92)
Use it on
A mesh with reasonably even UVs; keep the environment ambient light low so shadows stay dark.
Result
Paper-white shapes shaded with layers of crossing ink lines that thicken toward the shadow side.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/lit_hatching/

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

Lines follow UVs, so seams and stretched UVs show in the strokes. Each light adds its own hatching. Ambient light is added unhatched. Lines alias into moire when UV density is far higher than screen pixels.