cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

BigHands
Journeyman III

Alpha test disables Early Z?

For a long time without giving it much tought, I've accepted that turning on alpha testing disables Early Z.  Emil Persson also mentions this in his "Depth In-depth" AMD white paper.

I have been thinking about this lately and, to me, it doesn't make sense why alpha testing would disable Early Z.  Why would Early Z care if the pixel is going to be accepted or rejected by the alpha test?  The only case I can think of is Early Z saying the pixel is visible, but then alpha test failing.  This would simply be a waste of processing time, but I would imagine that the average texture with alpha test information has more pixels that should be visible than not.

Thanks for sharing any thoughts.

 

0 Likes
3 Replies
pboudier
Staff

the issue with alpha test and early z comes from the following:

- the depth test is really a read/modify/write, so if you pass depth test in earlyZ, then you will write the new depth value right away

- when alpha test is enabled, a pixel could pass the depth test but still be rejected. in that case, the depth value would be modified incorrectly

Pierre B.

 

0 Likes

That makes sense, thanks Pierre.  Out of curiosity how did you know this?  It seems like I've read a ton of info on EarlyZ, HiZ, ZCull, et al., but have not come across this information.

 

0 Likes

I work for AMD, so I know how the HW works.

Pierre B.

0 Likes