Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Draw Order Question (Z-Test, Depth-Stencil)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 ~Helgon   Members   -  Reputation: 357

Like
0Likes
Like

Posted 23 November 2012 - 01:36 AM

Hey, i just have a question.


I've read that if i use the depth-stencil for a mirror i should draw the objects from back to front so that the depth can be checked.

Later i've read that if i want my graphic card to uses the build in z-test(Hardware - don't render if the depthComplexity > 1) i have to draw the objects from front to back (and it can have a significantly impact in performance)


So, whats the right way?

Regards Helgon

from time to time i find time


Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7987

Like
2Likes
Like

Posted 23 November 2012 - 01:56 AM

The right way is to utilze the z-test hardware as much as possible, because videochips are highly optimized in this field. Therefore rendering from front to back have the advantage, that front objects will block back objects quite early (early z-rejection) and this can have a significant performance impact.

Though, as always, there are some exceptions. E.g. alpha blending can't utilize the z-test , therefore alpha blended geometry should be rendered from back to front to avoid visual artifacts.

#3 C0lumbo   Crossbones+   -  Reputation: 2493

Like
3Likes
Like

Posted 23 November 2012 - 02:19 AM

Just talking about rendering opaque geometry on desktop graphics cards. Rendering front-to-back can improve performance because fragments can be skipped more often when drawing triangles that are occluded by other triangles.

However, you can also improve performance by batching triangles into single draw calls and by drawing 'similar' objects together so as to reduce state changes. This can improve both CPU and GPU performance.

These two goals often conflict with one another. I tend to give greater weight to the second goal, only worrying about the first if I can cheaply and easily do some coarse sorting. Unless I'm in full profiling/optimising mode, then I'll let measurements and experiments tell me what to do.

#4 ~Helgon   Members   -  Reputation: 357

Like
0Likes
Like

Posted 23 November 2012 - 08:10 AM

Thanks for the awnsers

from time to time i find time





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS