- Home /
Geometry Shader vs Instancing for grass
After finishing a geometry shader that replaces a triangle with 3+ grass blades, I found out that I can't use Surface Shaders with Geometry Shaders, meaning that I will have to reimplement everything that the Surface Shader would do for me.
So I am asking for those who understand this better than me.
Which is better: Procedurally generating the blade grass mesh in the geometry shader, or using Instancing to drop a bunch of grass meshes and use the vertex shader to bend/animate the grass. Consider that both approaches will generate 'the same amount of grass blades'.
If using the geometry shader does not let me generate a whole lot more grass blades per 'performance drop', then it's not worth the effort to reimplement the surface shader and just figure out Instancing.
In the end I want to get a grass that is at least close to the Zelda: Breath of the Wild one
I would assume that you are better off with instancing. Firstly, it is much less work for you. Secondly, this way the amount of geometry and its placement is know ahead of time and can be optimized for.
Answer by trapazza · Sep 26, 2018 at 06:48 PM
I tried both approaches. Even if instancing is faster, using a geometry shader will let you do things that cannot be done otherwise, since you get control of every aspect of the grass generation (shape, angle, size, length, per-blade winds and deformations etc.
Even if you can't use surface shaders there's plenty of standard fragment shaders out there that you can use.