ALPHATESTENABLE

Started by
2 comments, last by xropi 21 years, 8 months ago
I read the following sentence: ''It''s usually a good idea to Turn the Alpha Testing off when it''s not needed'' in the article : ''Transparency in D3D Immediate Mode'' ( http://www.gamedev.net/reference/articles/article787.asp ) WHY? If the test fails, access to the source colour is not required to render the pixel. This is speed-up, isn''t it? Ropi
I'm interested in full featured 3D system development.
Advertisement
When alpha testing is enabled (and regardless of whether it fails or not) a per-pixel testing operation is performed. If you know that the alpha test is not needed, you can avoid this unnecessary operation by turning alpha testing off.


[edited by - spock on August 15, 2002 7:06:49 PM]
Ok, it has extra cost to check weather or not to perform the blending, but:

cost of test : x extra cycle (I suppose x = 1)
cost of blend op : > x cycle (reading memory for dest pixel, make the linear combination of src and dest colours, write back pixel)

If it''s well implemented in hardware, alpha test should be very fast.

Why alpha blend operations so slow? Because of the memory reads while calculating the output colour. This needs huge memory transfer rate and this is the reason of the slowdown.

I still can''t imagine how can be an internal cmp op. so bad!
I'm interested in full featured 3D system development.
If you know that the alpha test will ALWAYS pass/fail, there''s no reason for the test. For example, if you are always blending with 50% transparency, there''s no reason to test.

But you''re right, it''s very fast in any case.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials

This topic is closed to new replies.

Advertisement