Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Sudden performance plummet

  1. #1
    Newbie Newbie
    Join Date
    Nov 2013
    Posts
    2

    Sudden performance plummet

    So I render everything I have on-screen from a single big VBO, about 22 mbs in size, with the vertex data being 64 bits in size. I seem to be getting a performance drop when I render models, and it seems to be only in some places, and funnily enough, in some angles. It seems, that even though my view origin is in the same spot, and the amount of polies being processed is the same, depenging on what angle I look in, performance is either excellent as usual, or it suddenly plummets down to about 30 fps, from the standard of 60+ fps. As I said, polycounts are the same, and I can solely trace this to my glDrawElements calls with the profiler. I also use an element array to store my unsigned int index array.

    And the weird thing is, with models, the performance drop is not gradual. It's either a perfect 60+ fps, or a very sudden drop to 29-30 fps. The models are being drawn in multipass, which looks like this:
    1 - One pass with all non-shadowed per-pixel lights and ambient lighting
    2 - One renderpass for each texture-based projected light, with optional shadows
    3 - One pass for textures
    4 - Another for fog

    I really don't understand this behaviour, has anyone else ever encountered this?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    716
    Sounds to me that you have vsync enabled, and normally your time for a frame is just below 1/60 second, while for some views you just go slightly over and then miss the opportunity to swap buffers and basically sit waiting for the next vsync/buffer swap opportunity.

  3. #3
    Newbie Newbie
    Join Date
    Nov 2013
    Posts
    2
    That was exactly it. Now the lowest it goes is 56 fps or so. And here I was thinking I'm royally screwing something up with my code.

    Thanks for your help.

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,183
    On that thread, be sure you put a glFinish() after SwapBuffers() before you stop your frame timer. Otherwise you'll get whacky spikes in your timings that come from driver internal buffering details.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •