Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Ferazel on January 31, 2013, 05:35:50 PM
-
Hi,
I was just looking through the built-in shaders in NGUI and in the Transparent-Colored shaders there are two settings that I'm concerned about.
ColorMask RGB
AlphaTest Greater .01
The AlphaTest is the concern. Why are we doing another alpha test here? I know that more modern GPUs are much faster and don't have the problems with Alpha testing that the early PowerVR hardware did. I'm not a shader master, but I'm wondering why the shader is doing a test here? Has anyone done any performance comparisons?
The ColorMask is more of a curiosity. Why is a transparent shader not writing into the Alpha? Isn't that required in order to do subsequent alpha blending?
Thanks for any help or clarification anyone could provide.
-
Writing to screen there is no alpha, so writing to alpha is pointless.
AlphaTest happens whether you like it or not when alpha blending is enabled. Greater than 0.01 simply means that everything under 0.01 alpha will be considered as invisible and will not be drawn. This actually improves performance, not reduces it.
When in doubt, wikipedia this stuff. If you have such beginner questions about shaders, you better leave it as is or do some more research first. ;)