Baltor Get started

Gallery / Godot shaders

Procedural 2D grass field with wind

In your harnessGodot shaderMIT

Fill a rectangle with layers of grass blades drawn procedurally: each blade has its own height, width, lean and colour, bends with travelling wind, and back layers are darker for depth.

Render of Procedural 2D grass field with wind
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Shader type
canvas_item
Parameters
front_color (vec4 = 0.42, 0.72, 0.25, 1), back_color (vec4 = 0.12, 0.32, 0.12, 1), tip_color (vec4 = 0.8, 0.85, 0.45, 1), blades (float = 60), blade_height (float = 0.55), wind_strength (float = 0.06), wind_speed (float = 1.4), layers (int = 3)
Use it on
A ColorRect (or any CanvasItem) sized to the area to fill; UVs span 0 to 1 across it.
Result
A strip of layered green grass blades with light tips swaying in front of a blue sky.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/grass_field_2d/

Limits. Blades are flat colour without lighting. Very strong wind bends blades beyond the neighbour search and clips them. Cost is layers times three blade tests per pixel.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 62.6 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, opengl3 compatibility (Mesa llvmpipe, Xvfb)
Checks
contract static, engine run, engine log clean, shader in scene, capture written, render not uniform, shader changes pixels
Techniques
Hashed blade placement per slot with neighbour search, Height-squared wind bending, Back-to-front layer compositing, MurmurHash3 32-bit finalizer over prime-combined lattice coordinates as a hash
Tags
godot shader, canvas item, grass, field, wind, foliage, procedural
Identity
library.supply.creative_originals.53a0a06af6c118e174ffa629.391ded73ea99cf5a
Version
391ded73ea99cf5a5326d89d35f9611876443cfc788af334d4a01945c56c303d

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.