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?

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’

That’s it.

Good idea, going to implement that in my engine …

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.

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!