how to get the quantity of drawn triangles or points in OpenGL?

Started by
3 comments, last by 21st Century Moose 9 years, 8 months ago
In OpenGL,is there a build-in function that can get the quantity of drawn triangles or points?
Advertisement
The number of triangles drawn since when?
OpenGL doesn’t know how to answer this and thus there is no functionality for it.

If you want to know, keep track by yourself. Every time you draw you know how many triangles you are drawing. Add them by yourself and reset back to 0 at the end of each frame if you want to know how many triangles drawn in a frame.

Just remember to use a 64-bit unsigned integer type for it.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Can you clarify if you are looking for:

  1. The number of points, lines or triangles submitted via draw calls, or,
  2. The number of points, lines or triangles actually drawn on-screen after clipping, culling, etc?

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


The number of points, lines or triangles actually drawn on-screen after clipping, culling, etc?

I want to know this.


The number of points, lines or triangles actually drawn on-screen after clipping, culling, etc?

I want to know this.

OK, so keeping track of it yourself won't work, and there is no cross-vendor GL call for this. You'll need to rely on vendor-specific extensions (where they exist) and/or vendor-specific tools to get this information.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement