Search Unity

Question Lighting indoors scene with no ambient lighting in URP

Discussion in 'Universal Render Pipeline' started by fDaz, Jun 1, 2023.

  1. fDaz

    fDaz

    Joined:
    Oct 11, 2022
    Posts:
    2
    Hello all,
    I've been stuck on the following problem for quite a while now, and I can't find any resources or examples of how this is generally solved and every time I think I found a solution I keep hitting walls. My goal is to have a scene that has certain areas of the map fade into complete darkness.
    - From what I understand there's no way to disable ambient lighting for only certain parts of the scene, so I have to remove ambient lighting completely
    - This means that for the lit parts of the scene I have to manually place ligths - my plan was to bake the static shadows into lightmaps and have dynamic objects use realtime lighting with no shadows. However, because of light fall-off, I have to make the light range much higher than the room or area I'd want the light to affect.
    - This causes an issue with the forward rendering, as because the increased light range there are many overlaps regarding lights where light ranges in one room bleed over neighbouring rooms or the corridor they open to, even though that light shouldn't affect that area at all. Because of the per object light limit, this means that objects reach that limit very quickly even though a lot of the light that are technically in range shouldn't affect them at all.
    This causes all kind of issues with mixed lighting for dynamic objects, like one side of the door being completely dark while the other is lit (probably because the dark side takes the lighting data from a light further away instead of one that is closer to it) and flickering lights with dynamic lights that can happen during runtime. Changing from forward rendering to deferred isn't really an option as I'm developing for VR.
    Unfortunately all the examples I looked for interior lighting uses ambient lighting/directional lighting as a base with spotlights to make the scene look less flat so I couldn't find a good solution even though I've seen games with scenes that had well-lit areas and also completely dark ones. Right now I'm using two lights at once: one baked for static objects and one realtime for dynamic objects, which works well more or less though it's probably less than ideal.
    Anyone has any suggestion for the above issues or just creating scenes without ambient light in general?