top of page

Create Your First Project

Start adding your projects to your portfolio. Click on "Manage Projects" to get started

Geometry Grass Shader

Unity Shader

This is a unity grass shader, in which I adopted the knowledge of geometry shader.
I tried to simulate the blade shape, facing, curve and movement of real grass.

The basic idea is:
(1)Generate triangle with vertices using geometry shader as grass blades
(2)Define the property in tangent space, and use TBN matrix to transform to local space
(3)Lerp the bottom and top color of grass blade to create a gradual change of color
(4)Randomize the facing, blending and size of grass blades
(5)Use the hull shader and domain shader in tessellation process to make the grass denser
(6)Use distortion texture to implement wind effect
(7)Subdivide every grass blade to add more segments, and thus curve the grass blade
(8)Use shadow map to make it possible for the grass to accept and project shadow
(9)Add simple Lambertian light effect to the grass

***You can click on the video at the bottom to view its effect***

bottom of page