Shadowmaps and transparent objects

I have basic shadows working well.

I also have some models with some transparency e.g a tree model with some transparent quads as leaves.

I have alpha testing working to render the tree and leaves just fine.

However, the shadows for the tree are wrong since the shadows for the leaves render as quads and not leaves.

What would be the best / most efficient way to render shadows for these types of models?

Use clip to ignore the parts where the leaves are transparent when Rendering the shadow map.

1 Like

@Kwyrky Thanks for the response. That was my initial thought for how this should be done. It does require passing the textures to the shadowmap and sampling in the texture n the pixel shader (which isn’t currently required).

Was wondering if there was a better / more efficient way, but it doesnt’ look like there is.

I guess that’s the price to pay for having models with transparency.