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.
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
WebGLShadowMap automatically overrides a bunch of material settings, including alphaTest and map, even when a customMaterial is provided, which doesn’t seem right if the goal is to let the user control how shadows are cast in a custom way.