โ† All examples

godot shaders

Grass blades swaying in travelling wind gusts

Vertex wind for grass and plant cards: blades bend more toward the tip, gusts travel across the field as moving noise in world space, each blade gets its own phase, and the blade is cut to a tapered shape with a root to tip gradient.

Recorded render of Grass blades swaying in travelling wind gusts

What this component contains

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

How it works

Shader type
spatial
Render modes
cull_disabled
Parameters
root_color (vec4 = 0.12, 0.26, 0.08, 1), tip_color (vec4 = 0.58, 0.78, 0.3, 1), wind_angle_degrees (float = 30), wind_strength (float = 0.25), gust_scale (float = 0.35), gust_speed (float = 1.2), flutter (float = 0.05), taper (float = 0.9) and 1 more
Use it on
Grass cards whose UV v runs from 1 at the root to 0 at the tip (a vertical QuadMesh with its origin at the root, as in the demo); enough vertical subdivisions to bend smoothly.
Result
A patch of tapered grass blades leaning and waving as gusts pass.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/grass_blade_sway/

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

Blades bend but do not keep exact length or collide. Per-blade variation uses the instance origin, so all blades sharing one mesh instance move together. Discard-based shape costs fill rate on dense fields. Shadows follow the moving shape.