Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

Marching Cubes Geometry Shader

$
0
0

Does this sound right?

  1. Make a buffer with 8 attributes – a vec4 for each of the 8 points in the marched cube. That's a lot of attrib pointer function calls, but it should be fine… hopefully better than using a whole bunch of texture bindings.
  2. Use a geometry shader to take points as input, and outputs a triangle strip of max 5*3 = 15 vertices.
  3. Disable fragment shader: glDisable(GL_FRAGMENT_PROGRAM);
  4. Draw the points.
  5. Output the triangles to the CPU using transform feedback.
  6. Re-enable the fragment shader.

P.S. One implementation that I found used texture sampling, instead of giant …


Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>