// Rendering
Grass for large environments
The grass is drawn with GPU instancing through DrawMeshInstancedIndirect and loads in chunks. The blades move with vertex animation in the shader, driven by the shared wind include.
Open to work · Relocation ready
Stylized top-down RPG · Unity URP
In development
A stylized top-down RPG made at Elven Empire, still in development. I built its custom grass rendering system for large environments and the shared wind shader that moves the vegetation.
// Rendering
The grass is drawn with GPU instancing through DrawMeshInstancedIndirect and loads in chunks. The blades move with vertex animation in the shader, driven by the shared wind include.
// Tech Art · Shaders
A single include, WindCore.hlsl, drives the grass, the flowers and every other object that sways. Layered value noise (FBM) makes the steady breeze. A travelling gust wave adds bursts on top of it.
Each vertex bends with the wind and then sags, which keeps a blade from stretching. The include depends only on _Time.
// travelling gust wave
float wavePhase = dot(worldPos.xz, dir) * 0.1 - time * 0.9;
float waveFront = smoothstep(0.90, 1.0, sin(wavePhase));
float totalWind = lightBreeze + waveMask * 0.7
+ windNoise * (lightBreeze + waveMask) * 0.4;
// bend the blade, then sag so it never stretches
worldPos.xz += (dir + swirlDir) * bend;
worldPos.y -= (1.0 - sqrt(1.0 - bend * bend)) * heightT * scale;
// Shaders · Lighting
Besides the grass, I wrote URP shaders for water and vegetation and built custom lighting for the game.