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 2 of 2

Thread: When all vertices have the same Z-position the performance drops heavily

  1. #1
    Intern Contributor
    Join Date
    Sep 2013
    Posts
    89

    When all vertices have the same Z-position the performance drops heavily

    Hi there.
    I was fooling around with OpenGL a little and was just doing some random performance tests to see how far my hardware can go.
    After creating random vertices for about one million triangles I still had a constant 60 frames per second. Which is nice.
    However, I once tried to set the Z-coordinate for all vertices to 0.5 (x and y are still random) and suddenly the frame rate dropped like crazy. I hardly got 200 000 triangles until my frame rate started to drop.

    The depth buffer function I used was GL_LESS. I use orthogonal projection by the way.

    Why is that? What is causing so much trouble if all vertices share the same z position?
    Thanks for all your answers.

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,162
    Since your vertices positions are generated randomly, many of them are huge and completely cover others. In this case, early Z gains huge speed boost because most of the pixels are not drawn. The second test probably blocks early Z and all pixels (or most of them) are drawn. Neither of those test would give you any useful information about your graphics card. Try to make some more realistic ones.

Posting Permissions

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