I wanted to try drawing grass with shaders.
The idea is to construct 30,000 blades of grass and then have them positioned with the vertex shader to respond to the player’s helicopter. The grass should all face away from the helicopter blades. But away from the helicopter they should point “upwards”, maybe modulated by noise. And to make it look visually upwards, I want to use an oblique projection like I did in mapgen4.
- Make a “blade of grass” geometry as an instance.
- Make one position and noise value per instance.
- Make the vertex shader position the grass.
- Make the vertex shader take the helicopter position into account.
I made the fragment shader vary the color on the blades so that it doesn’t look like a solid sea of green.