Here’s the shader I’m currently using to render the grass on my terrain. It’s quite basic and just renders the base color and normal and displaces it using a sine wave to make it look like it’s swaying. I would like to get some more performance out of it. My fps is around 250 with the grass off and around 190 with the grass on.
The grass are terrain details that render my billboard mesh using GPU instancing, and this shader. Grass on/off by toggling the Draw bool in the Terrain components Tree+Detail section.
CPU [ms] | GPU [ms] | |
---|---|---|
Grass being rendered | 7.0 | 2.6 |
Grass not being rendered | 5.3 | 2.5 |