Draw mixed geometry

Started by
13 comments, last by Infinisearch 7 years, 5 months ago

You can't change topology mid draw call. You'll either have to sort your polygons by number of vertices per face (draw call for each) or triangulate the polygons.

-potential energy is easily made kinetic-

Advertisement

I've rebuilt my code to use glMultiDrawElements. This call looks appropriated but I see no any speedup - same fps as with multiply glDrawElements ;-( It was unexpected, I hoped one call should be faster than hundreds (sometimes even thousands).

So now I make a copy of "indices" and sort it, then pass the copy to VBO. It's twice faster although works well for static geometry only

Thx

I've rebuilt my code to use glMultiDrawElements. This call looks appropriated but I see no any speedup - same fps as with multiply glDrawElements ;-( It was unexpected, I hoped one call should be faster than hundreds (sometimes even thousands).

I heard some IHV's drivers implement Multidraw using multiple draw calls, so maybe thats why you saw no speedup.

The other thing is how big are the clusters of geometry you are rendering, you might be running into occupancy issues.

edit - Also it should be mentioned that reducing draw call count is a CPU optimization, and not changing state between draw calls supposedly gives you more draw calls per frame to work with.

-potential energy is easily made kinetic-

The other thing is how big are the clusters of geometry you are rendering, you might be running into occupancy issues.
I'm testing with user's project 4.6 millions of polys, approx same vertices. 130 objects, a half of them have intensive triangles/quads mix.

I heard some IHV's drivers implement Multidraw using multiple draw calls
Is there a way(s) to transform this "some" into something more concrete that I could use in runtime? For example (pseudocode)

if (SomeTest())

// use glMiltiDrawElements

else

// rebuild indices

Th?

I'm testing with user's project 4.6 millions of polys, approx same vertices. 130 objects, a half of them have intensive triangles/quads mix.

Thats not what i meant, I mean the clusters as in first draw 20 triangles, then another 60, then another... and so on. If the clusters are too small you're not using the gpu as efficiently as possible leaving performance on the table.

Is there a way(s) to transform this "some" into something more concrete that I could use in runtime? For example (pseudocode) if (SomeTest()) // use glMiltiDrawElements else // rebuild indices Th?

I don't know/remember the specifics of which IHV does what and moreover I don't know if it depends on hardware generation. So basically I can't help you here, besides the dynamic index buffer is a good solution which also solves the occupancy issue.

-potential energy is easily made kinetic-

This topic is closed to new replies.

Advertisement