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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Combining Baked and Realtime Lighting

Discussion in 'General Graphics' started by RdArrogantKnight, Nov 23, 2015.

  1. RdArrogantKnight

    RdArrogantKnight

    Joined:
    Jun 24, 2013
    Posts:
    13
    I have a scene with lots of baked lighting, but I'd like the player character to cast and receive shadows when they move around in the environment. Is there a good way to do this? I've tried setting my light to Mixed, I've tried having multiple light sources (Baked and Realtime) and it seems like I can only ever get Baked or Realtime lighting.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Have a few lights as realtime and other lights as baked.

    Mixed mode would be what you want but it's not working properly yet.
     
    Tinovdk likes this.
  3. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Is it still advisable to use layers in this context? Ie bake the environment lighting and have realtime lights only effect characters for eg on a set layer?

    This used to be the advised approach but with everything being reinvented I have no idea.
     
    theANMATOR2b likes this.
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Then the character wouldn't receive/cast shadows though, right?

    Also... I haven't tried that in 5, it will probably work, but I don't know if it's a good idea or not.

    What the OP wants is exactly mixed mode. But that doesn't work properly yet.

    In the meantime, I think having the bulk of the lights as baked, and a few, strategically placed, realtime lights will have good enough results. Just make sure you don't move those lights so the GI isn't updating, if you're going for performance :)
     
    AaronC likes this.
  5. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    294
    From my trial and error experiences, so far, I agree with AcidArrow. While the layer approach with using baked and realtime lights is possible, it seems to be very limited. While you can bake the static geometry lighting and use realtime light for let's say characters with a specific layer, from my tests the realtime light does not create shadows on the baked ground surface for the characters (it just lights them).

    At the end of the day, in my opinion, the current lighting options still somehow feel unsatisfying. I really hope that the Unity team improves on the mixed mode so that it works nicely in future (and also supports point lights).
     
    Last edited: Nov 25, 2015
    AaronC and Tinovdk like this.
  6. RdArrogantKnight

    RdArrogantKnight

    Joined:
    Jun 24, 2013
    Posts:
    13
    Like moco2k mentioned, when I bake the static geometry lighting and use realtime lights as a secondary light source for characters, the characters don't cast shadows on the baked landscape. Pretty pointless.