Shadow of mesh with node material , where the material is animated

How can I have the shadow of a mesh with a node material respect transparency without breaking the UV animation of the node material?

You will have to create a ShadowDepthWrapper for your node material, and at creation time, you will need to instruct the class of the name of the WorldPos and alpha variables in the shader code.

You can do it like this:

You didn’t have an explicit block with the alpha value, so I simply created a dummy Add block for that.

See Shadows | Babylon.js Documentation for more information.


Thank you so very much @Evgeni_Popov !

1 Like