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

Thread: speeding up depth testing

  1. #1
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    New Zealand
    Posts
    112

    speeding up depth testing

    hi there
    i was wondering would it be fast to sort my polys and draw them furthest to nearest with depth buffer dissabled than to just draw them in any order with depth testing on?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Dec 2002
    Location
    Poland
    Posts
    232

    Re: speeding up depth testing

    Sure it would be faster. I mean it would be faster if your sorting algoritm is good enough. Quicksort should be just fine. You can always make some experiments, you know. It isn't much of work, really.

    See ya'

  3. #3
    Member Regular Contributor
    Join Date
    Jul 2000
    Location
    Arlon, Belgium
    Posts
    486

    Re: speeding up depth testing

    That's it.

    Good idea, going to implement that in my engine ...

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    718

    Re: speeding up depth testing

    Stop spreading misinformation. Sorting individual polygons and disabling the depth buffer will have artifacts and it will be slower on any hardware that is newer than say 4 years old.

    Sort your objects (NOT individual triangles) and render in rough FRONT TO BACK (NOT back to front as suggested) order for some bandwidth saving on newer cards.

    In general if your program needs to spend cpu time for figuring out whether to render say 100 triangles or less, it's not worth it. Just rendering them will be faster. There are some exceptions to this, like if all triangles cover the entire screen and you're fill rate bound, but in general it's good advice.

  5. #5
    Guest

    Re: speeding up depth testing

    Yeah, drawing things in back-to-front order is one of the worst things you can do - you generate a huge amount of overdraw from all the pixels that later get obscured. Sort your polygons in front-to-back order and render with depth-testing. The sort doesn't need to be exact, but the better sorted your polygons are, the fewer unnecessary pixels get rendered.

    The depth buffer is very, very efficient. It would be foolish not to take advantage of it!

Posting Permissions

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