Jump to content


Run geometry shader over newly-created geometry?


3 replies to this topic

#1 Tottel

    Member

  • Members
  • PipPip
  • 49 posts

Posted 08 June 2012 - 11:02 AM

I'm trying to subdivide a quad (2 triangles) multiple times.

I send it to the geometry as triangleadj and ouput 8 triangles from that.
However, I want to subdivide multiple times and someone told me I can send the geometry output back to the vertex shader and run the geometry shader again on that new geometry. He couldn't tell me how though.

Does anyone have any experience, or tips about this? I'm using DirectX10, so I cannot use tesselation instead.

Thanks.

#2 Vilem Otte

    Valued Member

  • Members
  • PipPipPipPip
  • 345 posts

Posted 08 June 2012 - 11:58 AM

You can stream out geometry shader output to vertex buffer. Then you can re-render it using same shader (and again stream out the result), etc. unless u have enough tessellated geometry.

The other way is to write multiple-times tessellation directly in geometry shader (also possible! though it's still a lot slower than using DirectX 11 tessellation or GL_ARB_tessellation_shader in OpenGL 4 and higher.

Note, that second way might be faster than first one ;).
My blog about game development (and not just game development) - http://gameprogramme...y.blogspot.com/

If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D

#3 Tottel

    Member

  • Members
  • PipPip
  • 49 posts

Posted 08 June 2012 - 12:00 PM

Thanks, How exactly do you stream out back to the vertex buffer?

#4 Reedbeta

    DevMaster Staff

  • Administrators
  • 5311 posts
  • LocationSanta Clara, CA

Posted 08 June 2012 - 04:25 PM

Tottel, see the MSDN docs for the details of how to set it up.
reedbeta.com - developer blog, OpenGL demos, and other projects





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users