-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Closed
Description
Description
For a texture with transparency, alphaTest can be used, but if using alphaToCoverage instead, shadows lack alpha. This is problematic for cases like grass billboards where the docs recommend to use alphaToCoverage, but don't explain how / what needs to be configured to get alpha on the shadow.
Here's an example:
https://codesandbox.io/p/sandbox/exciting-water-hz8k92
Solution
When writing to the shadow map, don't just consider alphaTest, but also alphaToCoverage.
Alternatives
Tried using MeshDepthMaterial, but have not been able to achieve any good result with map + alphaTest or alphaMap. However, using alphaHash is showing transparency in the shadow now so that is helpful.
mesh.customDepthMaterial = MeshDepthMaterial({ alphaHash: true })
mesh.customDepthMaterial.depthPacking = RGBADepthPacking
Additional context
No response
KurtPachinger