Hello,
I’m trying to render shadows only if the object they are drawn to is after a certain distance. For example, I want to keep both cubes’ shadows in the green circle, but remove the shadow of the top cube on the bottom cube (red circle) because the bottom cube is close to the top cube:
To do so, I’ve been using the “Shadow Pass Switch” node hoping I could just compute the distance between pixels and the object, therefore hiding the shadow for those pixels that are too close:
This however doesn’t work. At best, I can get “holes” in my shadow which seem to indicate that the results of the object position distance from world position are always the same:
I also tried using a sphere mask at the specific location of the lower cube:
And I get this:
Any kind soul can tell me what I am doing wrong, and if this is even achievable? I’m basically trying to achieve selective shadows so that an actor does not receive the shadows of a selected other actor. This could be achieved with lighting channels, except that… Lumen.
Thank you in advance.