Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

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

Discussion in 'Universal Render Pipeline' started by Kromah, Mar 17, 2021.

  1. Kromah

    Kromah

    Joined:
    Jan 20, 2013
    Posts:
    10
    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!
     
  2. Kromah

    Kromah

    Joined:
    Jan 20, 2013
    Posts:
    10
    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?
     
  3. vicator

    vicator

    Joined:
    Oct 12, 2014
    Posts:
    30
  4. corb555

    corb555

    Joined:
    Apr 27, 2013
    Posts:
    13
  5. vicator

    vicator

    Joined:
    Oct 12, 2014
    Posts:
    30
    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.