โ† All examples

godot shaders

Matcap shading with a procedural sphere texture

Light a mesh entirely from a matcap: the view-space normal looks up a lit-sphere texture, so shading is baked and costs one sample. Ships with a procedural gradient matcap and accepts any matcap image.

Recorded render of Matcap shading with a procedural sphere texture

What this component contains

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

How it works

Shader type
spatial
Render modes
unshaded
Parameters
matcap (sampler2D), tint (vec4 = 1, 1, 1, 1), rim_strength (float = 0.25), rim_color (vec4 = 1, 1, 1, 1), cavity_strength (float = 0.3)
Use it on
Optional: a square matcap image assigned to `matcap` (the bundled material uses a procedural one).
Result
Objects shaded like soft clay from the matcap colours, the same from every light setup.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/matcap_gradient/

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

Lighting is fixed to the view, so it turns with the camera and never casts or receives shadows. The cavity term only darkens where normals change within a pixel quad, which is subtle on smooth meshes. Matcaps with a visible horizon look wrong when the camera rolls.