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. Dismiss Notice

Question Any tricks to implement doors in baked lighting scene?

Discussion in 'General Graphics' started by mrbaconvn, Sep 19, 2023.

  1. mrbaconvn

    mrbaconvn

    Joined:
    Dec 29, 2019
    Posts:
    3
    Hi everyone, I'm new to baking light in Unity. I have one question, are there any tricks to implement interactable doors in baked lighting scene? I know baked lighting only apply for static objects but there should be a trick to implement this without using 100% realtime lights right? I see a lot of games like dark deception have interactable door but still achieved baked lighting quality.

    upload_2023-9-19_21-38-52.png

    In my game I have a hallway (with baked area lights) and dark rooms. If everything is lightup evenly I can just ignore the door and set it to be dynamic (not static) because whether the door is open or close, the lighting would be the same. But in my game the lights are not lightup evenly (light rooms and dark rooms seperated by interactable doors). I'm not saying it should be 100% baked lighting but it should have some trick to mix between baked lighting and mixed lighting to achieve the GI, quality & performance.

    Thankyou.
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,466
    No secret:
    - bake twice.
    - Then diff the map to extract the delta,
    - then you have to decide how much of that difference you need to be plausible,
    - then you decide which solution to swap results, such as tiling, localized lightmap, etc...

    Other solution, dynamic light I mixed rendering mode.
     
  3. mrbaconvn

    mrbaconvn

    Joined:
    Dec 29, 2019
    Posts:
    3
    So your solution is baked the map with the door opened and the map with the door closed and then switching between those 2 maps. What if there are a lot of rooms then I will have to bake a lot of variation of them right?

    I'm thinking of using baked lighting for the area that always receive lights. I will block the entrance of the room by an invisible static object so the baked light wont bleed in and I will use realtime point light to simulate the light bleeding in when the dynamic door is open. But it the dynamic lights cannot cast the same lights intensity as the baked light and it will shows a line (different light intensity inside the room and outside the room) at the door way. Are there any better methods?
     
    Last edited: Sep 19, 2023
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,466
    That's the solution call of duty did...

    Now you know why real time global illumination is a hot topic currently.

    You probably don't have the funding, but i'm doing research for a cheap real time GI lightbaking, it's research so there is no guarantee in end up in something useable, but: https://forum.unity.com/threads/exp...on-for-open-gl-es-2-0-and-weak-machine.752600 I need a decent computer, i'm broke, to finish this.
     
  5. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    547
    Have you tried light probes or an adaptive probe volume?

    I'm not sure if you can bake direct light into them but worth a shot.