Jump to content
  • Advertisement
Sign in to follow this  
noodleBowl

Geometry Shader: Numbers of verts out

This topic is 1284 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if anyone could help me out with a minor issue I'm having

 

Currently I have a geometry shader that is used to determine which GL_POINTS to discard. This geometry shader also generates new vertices.

But my issue comes in where I need to generate more GL_POINTS then the max_vertices is set for. EG max_vertices is 30 but I need to generate 41 vertices.

 

If the max_vertices is hit during the run of a geometry shader, it wont emit any more vertices and just cut out, so to get around this I create "generators" based on the number of vertices I need.

 

Unfortunately this is where my real problem lies. Using the above example, I want to generate 41 vertices, but I can only do 30 for each run of the geometry shader. So I create the "generators" using the formula:

"generators" = ceiling(generationCount / max_vertices)
"generators" = ceiling(41 / 30)
"generators" = ceiling(1.36)
"generators" = 2

Now, this is where I am kind of at a loss. I need 2 "generators" to get that many GL_POINTS out, but I do not know how to split them up evening in a way where the first "generator" will handle 30 vertices and the second "generator" will handle the remaining 11.

 

Any ideas?

Edited by noodleBowl

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!