PDA

View Full Version : How to improve FPS.



HiMyNameIs
07-28-2013, 11:29 PM
After I import a model with large vertex data,the fps is too low.
I 've already used the GLSL.Could you give me some suggestion about how to improve the fps?
I would appreciate your kiddly help.
1087
You can download my program here.(Most is the model.The program just hold a small part.)
https://files.one.ubuntu.com/PnJQKtYgRYWbrrncDxbKwg

tonyo_au
07-29-2013, 12:32 AM
I can't access your code without creating an account.

Generally keep your state changes to a minimum, keep the total number of OpenGL to a minimum, have large buffeer so you can draw alot with a single call

HiMyNameIs
07-29-2013, 12:44 AM
have large buffeer so you can draw alot with a single call
You mean calling draw function too many times would slow down the render speed?

AnkhDjedSeneb
07-29-2013, 01:57 AM
You can get excellent performance by using Vertex Buffer Objects (VBOs). Use them in conjunction with "index buffers" for shared vertices and your performance goes way up.

One of the biggest tricks to performance in OpenGL is trying to make you scene/application run within the GPU's video memory as much as possible, and minimizing transfers between main memory and video memory. VBOs, textures and index buffer arrays help you keep your data on the GPU, and reduce the overhead of function calls sending data between the CPU and GPU.

On a reasonable video card with 1 GB or more of video RAM you should expect to be rendering millions of polygons at 60 Hz.

Google tutorials on VBOs and index buffers and you'll see lots of examples.

HiMyNameIs
07-29-2013, 02:23 AM
Thank you very much.