I created a volume grass System for my voxel engine and want to animate it by shader (currently I use transparent cutout).
I am not good in shader coding and neither found any good tutorials nor good examples,
please help!
Here is a Picture that Shows the mesh (I imagine the grass softly waving in the wind) ; the texture is only projected on quads.
The common way to do it is by moving the verts in the vertex shader, usually by some kind of sine wave or triangle wave. If you have vertex colors in your mesh you can use one of the vertex color channels to mask out the movement(so the base of grass doesn’t move but the tip moves 100%).
You could take a look at how Unity implemented grass waving on a terrain. The file is located at:
“\Editor\Data\CGIncludes\TerrainEngine.cginc”
Take a look at the function called “TerrainWaveGrass” in this file.
The Normal Extrusion with Vertex Modifier example should give you a starting point. It demonstrates how to move vertices in a vertex-shader. You could adapt this approach with a few modifications to your grass-thingy.
If you want to go deeper, you can find some articles about vegetation rendering in CPU Gems: