Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Disabling cast and receive shadows does not work for light from emitting materials.

Discussion in 'Global Illumination' started by WBlackX, Jan 17, 2021.

  1. WBlackX

    WBlackX

    Joined:
    Nov 11, 2014
    Posts:
    6
    Hi, I am facing this problem and I want to know if it is normal or not.

    Turning off cast shadows works for lights from sources with a Light component. But it does not work for light that is emitted from a material object with emission on. This makes the shadows from this light a little lighter, but they remain (see screenshot).
    And yes, it's about baked light. As far as I know, emission materials can only emit light for baking.

    Also, unchecking the box to receive shadows on the shadow receiver does not change the picture either.

    Unity version 2020.2.1f1, URP version 10.2.2.
    But this is also playable on the old render pipeline, and on several previous versions of Unity.

    P.S. Is it normal that when I turn off the shadow for an object under a spot light, the surface under this object becomes lighter than the environment? I suspect this is a feature of GI and bounce light, but it looks strange.
     

    Attached Files:

  2. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    We don't support disabled shadows for emissive surfaces. The technical reason behind this is that even though we know where the lights in the scene are, we don't know the same for emissives. So during our light calculations, when we want to calculate lighting on a surface point, we can check this setting on the light. If shadows are disabled, we directly add the light, if shadows are enabled, we shoot a shadow ray towards the light and only add it if it's actually visible. Emissives on the other hand are detected when hitting a surface and evaluating the material on it. If the material emits light at the surface point, we add it to the current result for a path traced sample. In other words, we happen to stumble on an emissive surface by accident.
    In order to support the same functionality like with lights in an efficient way, emissive handling would need to be fundamentally reworked, but we have no near term plans for that.

    The assumption about lights bouncing multiple times leading to brighter results is correct. It may look strange, but you have a setup that's not really rooted in reality, anyway.