1

So, I have a functioning voxel engine that creates smoothed terrain in chunks of 1x1x1 meter in a 1024 radius around my player.

I wanted to create a geometry shader that not only continues to texture the ground appropriately, but also creates grass (preferably waving with the wind).

I have found some basic billboard geometry shaders to get me started, but they seem to cause the mesh to stop texturing. Is there anyway to do both from one shader?

Do I pass the mesh triangles and the new grass triangles on to the fragment shader with a flag? Thanks in advance!

Fattie
  • 27,874
  • 70
  • 431
  • 719
guitar80
  • 716
  • 6
  • 19
  • Well I would use that, but I'm not using unity terrain. I'm using my own voxel engine so that I can have caves. – guitar80 Feb 18 '16 at 02:13

1 Answers1

0

You can do this by implementing two passes to the shader as it turns out. My first pass is a simple surface shader, but my second pass is the geometry shader. The multi-pass still results in 130 FPS, so it seems to be adequate.

guitar80
  • 716
  • 6
  • 19