Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Light inside objects

Discussion in 'Getting Started' started by JanKrocak, Jul 11, 2021.

  1. JanKrocak

    JanKrocak

    Joined:
    Jul 11, 2021
    Posts:
    13
    Hello,

    I just started to learn Unity and have a question about the light which seems to go through the object's walls. I am attaching the image of two cubes created in the scene and image from inside of these. The shader I used is double sided. The project uses HDRP. All scene lights are disabled.

    It looks like there is a default light which affects the scene but I am really not sure where to look for it. How could I potentially get rid of it then please? Also how could I set the objects to avoid light coming through walls?

    Thank you very much in advance!
     

    Attached Files:

    • 01.PNG
      01.PNG
      File size:
      304.6 KB
      Views:
      291
    • 02.PNG
      02.PNG
      File size:
      630.8 KB
      Views:
      303
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    It's not a ray-tracer. A directional light source causes light everywhere. You can add shadows, which will cast down and create the appearance of light being blocked, though it's not quite the same thing. I don't use HDRP when I can help it, but google "Unity shadows HDRP" and I'm sure you'll find plenty about that.
     
  3. JanKrocak

    JanKrocak

    Joined:
    Jul 11, 2021
    Posts:
    13
    Thank you for quick answer Joe!
    I understand, but I would expect this won't be the case with ray tracing, or am I wrong? Directional light seems to work as predicted and doesn't cause light leaking through the walls, it is just adding of HDRI Sky or PBR Sky to the Volume which let the light through.
    I am going to search more on that topic, thanks for the useful tag!
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    You're right, with ray tracing this would not be an issue. But ray-tracing is extremely expensive and not available (in real-time anyway) on any of the platforms I care about, so I can't say much more about that.
     
  5. JanKrocak

    JanKrocak

    Joined:
    Jul 11, 2021
    Posts:
    13
    No worries, thank you anyway Joe.