โ† All examples

godot shaders

Wrap lighting with subsurface tint and back light

Soft skin and wax look with a custom light function: wrapped diffuse that lets light bleed past the terminator in a warm scatter colour, translucency where light comes from behind, and a soft specular.

Recorded render of Wrap lighting with subsurface tint and back light

What this component contains

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

How it works

Shader type
spatial
Parameters
albedo (vec4 = 0.88, 0.68, 0.58, 1), scatter_color (vec4 = 0.85, 0.2, 0.12, 1), wrap (float = 0.45), scatter_width (float = 0.35), translucency (float = 0.6), translucency_power (float = 4), translucency_distortion (float = 0.25), specular_strength (float = 0.25) and 1 more
Result
Peach-coloured shapes lit from behind and the side with a warm red glow along the shadow edge and through the thin capsule.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/wrap_subsurface_skin/

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

An approximation without real thickness: translucency is the same on thick and thin parts unless you scale it per object. Wrap lighting brightens shadowed regions, so cast shadows look softer than the light. Not energy conserving.