We’ve run into a case where we need to use Alpha Test to “cut” a model. Our model has a Vertex Alpha gradient, 0-1, from left to right. On the material, under opacity, we enable Vertex Color (which uses the Vertex Alpha channel), and then set a Alpha Test value. We noticed that realtime shadows don’t respect this value when using Vertex Alpha. When using textures instead of Vertex Alpha though, shadows do respect the Alpha Test value.
The following image is an example of a running application. The top row uses Alpha Test and a gradient texture. The bottom row uses Alpha Test and a Vertex Alpha gradient:
In the editor, shadows often freak out when using Vertex Alpha and Alpha test. Shadows flicker on and off depending on if you hover the mouse over the viewport or not, and the Alpha Test value that the light “sees” and uses for casting shadows depends on what object you have selected.
Also, using an Alpha Test value of 1 with Vertex Alpha seems to confuse the shader, creating an interference pattern. I’d expect a value of 1 would hide the entire object.
Here’s a test PlayCanvas project. Please take a look and see if this is something that can be fixed: PlayCanvas 3D HTML5 Game Engine