NodeMaterial + Shadows + ShadowDepthWrapper: how does it supposed to work?

Hi!

I’m building a game and need a custom shaders for weather effects (like snow, rain, etc). I am trying to do this with the help of NME. So the problem I’m facing with is: I can not get shadows (self-shadows and casted shadows) to work with this material. It has alpha channel and I absolutely need it to cast correct shadows not just rects.

I dug through documentation and through examples, looked the youtube channel videos on NME, tried to sue wrapper - no luck. And nowhere could I find this valuable info. Maybe I just don’t know how to look for that info in the end.

I see there is a ‘shadows’ output on Lights block, but I have no clue how do I use it.

Please, explain =))

Here is a link to playground: https://playground.babylonjs.com/#FEEK7G#1053
Here is a link to custom material NME: https://nme.babylonjs.com/#YITXFO#1

Hi @DesiredName and welcome to the forum

You can use discard block for that.

image

3 Likes

Hello, @Cedric! Thank you!

I looked up a documents on that block type… I would have never guessed the description is really scarce =)

1 Like

cc @PatrickRyan for the node doc to see if we can improve it for that node

3 Likes