4
\$\begingroup\$

I am a beginner. I have a problem with my frame rate. I am trying to see my GPUs maximum performance with using VBO. I saw that everybody says a GPU can draw 1 billion triangles (so 3 billion vertices) with VBO easily, is it right? If it is right, then why am I getting 37 FPS at only 8 million triangles (24 million vertices)?

I am not using a shader and I don't know how to use it.

My GPU is (amd radeon hd 6870).

When drawing 20k triangles, the frame rate is 6000, when drawing 8 million triangles, the frame rate is 37 and CPU usage 1%. I don't think the CPU is the bottleneck..

My code is like this:

I create in header file

GLuint terrainVBO;

I made an init() function:

glGenBuffers(1,&terrainVBO);
glBindBuffer(GL_ARRAY_BUFFER,terrainVBO);
glBufferData(GL_ARRAY_BUFFER,terrainVertices.size()*sizeof(terrainVec),&terrainVertices[0],GL_STATIC_DRAW);

and draw in my main loop:

glBindBuffer(GL_ARRAY_BUFFER,terrainVBO);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3,GL_FLOAT,3*sizeof(float),0);

glDrawArrays(GL_TRIANGLES,0,terrainVertices.size());

glDisableClientState(GL_VERTEX_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER,0);

Summary: How can I draw 500-600 millions triangles (1.5 billion vertices) with a good frame rate? I could only draw 8 million triangles.

\$\endgroup\$
  • 4
    \$\begingroup\$ Why do you need 500 million? Not even AAA games use that much \$\endgroup\$ – Bálint Jul 17 '17 at 17:47
  • \$\begingroup\$ 1200000000 vs. 296000000 triangles a second. Sounds about right considering the additional overhead of handling that much data. I guess the answer is "you can't". \$\endgroup\$ – user59192 Jul 17 '17 at 19:22
  • \$\begingroup\$ Yes, you can't, even with the newest GPUs I think you can get at most 10 millions. Search on YouTube particles simulations and you'll get an idea. (With a gtx 780 I could reach 6 millions if I remember right, but I think the bottleneck was the updating of particles CPU side, with a compute shader I think you can get something more \$\endgroup\$ – Liuka Jul 17 '17 at 21:06
  • \$\begingroup\$ Therefore is average value (8 million triangles= 37 fps ) ? is it normal ? and thank you for your comments guys \$\endgroup\$ – Emre Kaya Jul 18 '17 at 4:25
  • \$\begingroup\$ @EmreKaya Well, you shouldn't expect anything crazy with the naive approach. You should consider yourself lucky you are getting anything rendered at all with no shader. It is just unreasonable to expect to copy over that much data to the GPU and expect it to handle it fast. To get anything special, you will need to learn shaders, specifically the more advanced ones, so you can generate triangles in flight. \$\endgroup\$ – rationalcoder Jul 18 '17 at 4:45
1
\$\begingroup\$

I just don't know what you want to draw.
If you want to draw one object with that many triangles, you probably want to use indexed rendering. But if you want to draw that many independent triangles you should learn how to use instanced rendering because it's good for drawing many similar objects.
Maybe those two techniques can boost your performance. But as already said, it is ridiculous to draw that many triangles/vertices at once.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.