โ† All examples

godot shaders

Twist deformation around the vertical axis

Twist a mesh around its object Y axis by an angle that grows with height, with an optional wobble over time, rotating normals along so lighting follows the spiral.

Recorded render of Twist deformation around the vertical axis

What this component contains

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

How it works

Shader type
spatial
Parameters
albedo (vec4 = 0.85, 0.55, 0.25, 1), stripe_color (vec4 = 0.3, 0.15, 0.08, 1), twist_degrees_per_unit (float = 160), pivot_height (float = -0.6), wobble_degrees (float = 30), wobble_speed (float = 1.5), stripes (float = 6), roughness (float = 0.5)
Use it on
A mesh with enough vertical subdivisions (the demo box uses 48).
Result
An orange and brown striped bar twisted into a spiral that winds back and forth.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/twist_deform/

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

Normals ignore the shear term of the twist, so strong twists look slightly off in lighting. Collision and culling use the untwisted shape. Low vertex counts produce faceted spirals.