Website powered by

HLSL Stylized Grass with Wind Effect in Unity

Experimenting with HLSL and finally got some stylized grass swaying in the wind 🌿✨
This one uses a triangle SDF for shape definition and a simple wind effect in Unity.
It’s lightweight, flexible, and gives a nice artistic vibe—perfect for stylized scenes!

Triangle SDF in Tiled in the texture coordinate UV space

Triangle SDF in Tiled in the texture coordinate UV space

The noise affecting the Y axis with a gradient mask from the bottom to the top

The noise affecting the Y axis with a gradient mask from the bottom to the top

Using HLSL to make a for loop to add the layers of grass and make a gradient mask. Lerping the gradient mask with the color inputs.

Using HLSL to make a for loop to add the layers of grass and make a gradient mask. Lerping the gradient mask with the color inputs.

Final result for the HLSL Stylized Grass with Wind Effect in Unity