You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Forum post: https://forum.playcanvas.com/t/shadows-dont-work-when-using-vertex-alpha-and-alpha-test/29932
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:
https://playcanvas.com/project/1044631/overview/alpha-test-shadows
Related Forum thread:
https://forum.playcanvas.com/t/shadows-dont-work-when-using-vertex-alpha-and-alpha-test/29932
The text was updated successfully, but these errors were encountered: