Cast shadows on a translucent material

Hello there!

I’m working on a Hole io like game, and I’m using a translucent material for my ground, so I can have this cool effect:

ezgif-4-096a693c73


The problem is that the shadows of my meshes are not cast on the ground because of its material.

I have tried many things, but nothing seems to work.

Here is my material:

Thanks a lot for your help! :smiley:

The easiest way to fix this is to not use translucency- you seem to just be making things either completely visible or completely invisible.
Switch your blend mode from Translucent to Masked, and move the pin from Opacity to Opacity Mask.

Translucency is bad for performance. With masked you can make a part either completely visible, or completely invisible. You can also use the dithering node if you need something inbetween those two states.

Hi @rokenrock , thanks for your answer!

I already tried that earlier, but when I move the pin from “Opacity” to “Opacity Mask”, I got these two errors:

shadow3

Ah- I just realized you were using scene nodes.
That’s quite an odd way of going about it.

I’d recommend using a material parameter collection and sphere mask instead.



The parameter collection should have two parameters- one vector, one scalar.
The vector is the player position, and the scalar is the player size. You could also cram player size into the alpha channel since it’s a V4, but that may come back to bite you if you don’t remember.

Player size doesn’t have to be updated every tick, but player position does.

To get the parameter nodes in the material graph, you have to search for collection parameter:


Then select the collection and parameter name:

Finally, we use those as parameters in a sphere mask.

1 Like

Amazing, it works really great!

Thanks a lot for your help ^^

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.