A masked material with opacity mask set through distance field always cast a shadow

Hello everybody :slight_smile:

I have a material on a skeletal mesh that detect the distance field and set the opacity mask accordingly :

When the skeletal mesh is inside a mesh, it is visible, when it is outside, it’s invisible.
This thing works fluently.
My problem is that the masked material still cast a shadow when it is fully transparent (opacity mask set to 0) :

If I disconnect my DF mechanic in the material and set the opcity mask with a simple constant 0, the shadows desapears normally but when I use DF to build the mask, they remain.
I tried to use an IF node and set the opacity to 1 or 0 acordingly to the result of the DF test but the shadow remains…
I think it’s due to the absoluteWorldPosition node presence…

Is it a bug or a fiunctionnality ?
How can mask my shadows in this case ?

Hi, I’m having the same issue. Did you manage to solve it?