Sign in to follow this  
noodleBowl

Geometry Shader: Numbers of verts out

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this