2

I am working with light propagation volumes and I have stumbled upon a problem with WebGL where I need a geometry shader or something to emulate it. I am working with 3D textures and I need to be able to render to a 3D texture. I found this in guide for DirectX 11:

Because of the way DirectX11 handles Render Target Views for 3D textures, you need to pass the vertices to a Geometry Shader, where a depth slice of the 3D texture will be determined based on the grid position. In the Geometry Shader you specify the SV_renderTargetArrayIndex, a variable you have to pass to the Pixel Shader and a variable that is not accessible in the Vertex Shader. This explains why you need the Geometry Shader and not just do a VS->PS call.

How would this be achieved in WebGl where geometry shaders are not available?

Marcus
  • 164
  • 1
  • 13
  • 3D textures only have support going from WebGL2. You could try to substitute a 3D texture for an array of textures. A limited emulation of something that 'looks' like geometry shading could be done by placing duplicates of mesh verticies in a float texture and passing UV's of neighbouring verticies as attributes. – Mr. Reddy Apr 18 '18 at 08:38
  • Thanks for you answer. I solved the problem by instead of using a 32x32x32 texture I use a 1024x32 texture. – Marcus Apr 20 '18 at 13:22

0 Answers0