Search Unity

Exactly what does overlapping mean?

Discussion in 'Global Illumination' started by AndersMalmgren, Jul 14, 2017.

  1. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Hey,

    We have a scene which is an interior scene with two floors, there is a roof mesh and a floor mesh separating them. Both is static. Shouldn't that mean that two lights on each side does not count as overlapping?

    It seems it does not work that way

    upload_2017-7-15_0-35-12.png

    There are only two lights overlapping on top side, and 3 on the bottom, but the red light is skipped as mixed after bake (it does not cast shadows from dynmic objects)
     
  2. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey @AndersMalmgren

    As far as I can see you have five mixed point lights. What matters for overlapping is the radius of your lights. If the radius of all your mixed lights is overlapping, then the last light in the rendering queue will fallback to baked as you observed. Now, this is a technical constraint of shadowmask system. Given that you've an interior scene with a short shadow distance, you can also try baked indirect system. In baked indirect, you won't have shadows beyond shadow distance and both static and dynamic objects will cast realtime shadows but can be more convenient for your use case. I hope this helps.

    Thanks
     
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks for reply @kemalakay

    Tried it, the quality of real time shadows in Unity are too low to be used for static objects. To use it for dynamic objects is just out of necessity :D Plus we target SteamVR and real time shadows for everything is not plausable

    I understand the limitation, a sphere radius is very cheap. Couldnt you somehow bake the info into the lightdata, since we are talking static objects. I guess I just have to place the mixed mode lights were it gives really dramatic effect! Thanks
     
  4. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Yes, then I would recommend just setting one of the point lights to baked instead of mixed and manually adjusting its placement to achieve the best look. And yes, I agree that if you're targeting VR, distance shadowmask and baked indirect are not the way to go. You should use regular shadowmask or subtractive. But given that in subtractive you can only use one mixed directional light, shadowmask mode is your best option. Good luck with the project! :)
     
  5. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi @kemalakay, sorry for resurrecting the thread: I understand that overlapping works taking into account the light radius, but having a system that takes into account if they actually overlap would be great!

    Is this kind of optimization possible in the roadmap?
    What about rising the Shadowmask to 2 masks, rising the number to 8, or splitting the precision to half, using half channel for each mask?

    would performance degrade so much? I have plenty of situations when 4 overlapping (with radius) lights isn't usable.

    using floats intead of bytes is only making it worst, isn't it? :p - but you could have infinite overlapping lights, at a cost.
     
    devotid likes this.