How to prevent spot light from shining through/under walls?

I have found many topic with this questions, some from 2013, but none of them seem to give the answer to this.

I have a spotlight that is directed towards a corner of a wall. But whatever I do, the light can’t stop shining through the wall and be visible on the other side:

The properties of the spotlight:

This is even more problematic in my case considering I need very strong intensity light with high range and spot angles.
I’ve tried “merging” the wall and the floor into a single mesh exported from Blender but the problem is exactly the same.
Is that a known problem that developers are used to cope with? I’m using URP.

Thanks!

It looks like this problem can be avoided if the light is facing the wall + the near plane value is correctly set up but as soon as the light turns a little bit you can see it bleeding through the wall again.

Still no one to help me with this?

Hi Kromah,
I have the exact same question on the topic. It is frustrating to understand the reason for this.

Are you experiencing something like i asked about in this post (watch the video)?

https://forum.unity.com/threads/should-spotlight-pass-through-parallell-side-walls-in-a-simple-booth.1070594/

This seems to be a similar issue and solution: Unity - Manual: Fixing lightmap UV overlap

Hi @corb555 . Thank you for the comment, however that is for objects using baked lightmaps. Are you using realtime light @Kromah ? In the example I linked to I am using realtime lights. No better luck if I join the geometry.

I had a similar problem and solved it by making the receiving material opaque (i.e. the material of the objects on the other side of the wall). Anything else does not apply shadows and seems to look like the light is let through.

I’m not sure, but it seems that if the near plane of the spotlight is ever inside the wall the light goes through. As Kromah says, even with this, rotating messes it up by moving the near plane into the wall.

For me, it worked when I set the “Mesh Renderer → Cast Shadows” to “Two Sided” for the wall you want to block the light. I’m guessing that lets the mesh block the light even if the near plane is inside it.