-
Junior Member
Regular Contributor
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?
-
Junior Member
Regular Contributor
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'
-
Member
Regular Contributor
Re: speeding up depth testing
That's it.
Good idea, going to implement that in my engine ...
-
Advanced Member
Frequent Contributor
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.
-
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
-
Forum Rules