Make the opacity mask not affect the shadows?

Is there a way to make the opacity mask not let the light pass through, so that it doesn’t affects the shadows?

It would be useful to see through buildings from above for example, without letting the sun light come in or change the building shadows.

For static lighting you can use the “lightmass replace” node.

For dynamic lighting you would have to construct some kind of dot product mask that makes a hole only when the view angle matches the sun angle, but without some code tweaks there would be no way to keep it from being see-through if the player camera actually got close to the sun angle so it will not be very robust. You could possibly fix that with an additional camera position mask to see if the camera is inside of a building. There are some material functions called boxmask there are like box spheremasks.

I am using dynamic lighting. That wouldn’t work for the effect I am trying to achieve unfortunately:
[video]- YouTube

The only workaround I can think of is an invisible mesh that casts shadows.

I think you are right.

For a long time I could not solve this problem, so that meshes with an opaque mask cast a shadow.
And recently I found a very simple solution, you just need a “Shadow Pass Switch” node.
I am writing this for those who, like me, will face the same problem.

7 Likes

Thank you for posting this after finding the solution. I needed this and it’s a hard one to lookup without having the right keywords.