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

Best way to light static and non-static objects - Example: House

Discussion in 'Global Illumination' started by Tech-Labs, Jul 29, 2016.

  1. Tech-Labs

    Tech-Labs

    Joined:
    Feb 5, 2014
    Posts:
    99
    Hi,
    I've been trying to figure out how to do this, but even with the Unity docs, other website and forums I haven't been able to wraps my ind around it completely.
    It's all about lighting.

    I have a house (basic modern home). When I make the house (lightmapped) static and bake a lightmap it looks fine!
    I've got 1 directional light. Set to Baking and Soft Shadows (rest default).
    All object in the house are set to Lightmapped Static. All objects cast and receive shadows.
    Using Unity Pro 5.3.6.

    But doors and windows should be able to move and cast shadows. So I need real-time shadows as well.
    But the door and windows should not look out of place. So making them non-static and removing them from the lightmap is no option as they will look very different.
    And because both the doors and the windows have glass (transparant) and wood (non-transparant) the baked light-shadow does not work when moving a door or window!
    And Mixed mode does not seem to work.

    It doesn't seem right to just add a duplicate of my directional light (set both to an intensity of 0.5 instead of 1.0) and make that duplicate a realtime light.

    Using Precomputed GI doens't look half as good either.

    I'm really confused in what setup I should choose to get the scene lighted using the power of baked lightmaps but still have realtime light/shadows for moving objects. The theory is simple, putting it into practice however....

    Thanks for any suggestions!

    Marco
     
  2. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    Basically, because Unity does not have mixed lighting, there isn't a way to achieve what you want yet. It was originally planned for 5.3, then 5.4, and now 5.4 still doesn't have it.

    If your target hardware allows it, you should have all your lights in real time - this will enable real time global illumination and point and spot light cookies (for IES lights) as well.
     
  3. Tech-Labs

    Tech-Labs

    Joined:
    Feb 5, 2014
    Posts:
    99
    Right. I understand and that's more or less what I suspected. But. That does leave you without the nice baked lights effects such as bounces and better defined shadows. That's really too bad! Hopefully Unity will add a working version of Mixed mode lights soon!

    Thanks!
     
  4. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    Bounces are still included - Unity has real time global illumination (i.e. bounced light). You can read about the global illumination system here.
     
    AcidArrow likes this.
  5. minev

    minev

    Joined:
    Nov 19, 2014
    Posts:
    34
    Real time lightmaps can give you nice 'bounces and better defined shadows', at high settings, such as here:




    (images by Alex Lovett)

    Considering you need both dynamic objects and high quality, Realtime lightmaps look like only solution for you.
     
  6. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    Dynamic doors will always be an issue with a lightmapped setup. The best you can do right now is plan your lighting around it, so when the door's closed, there won't be a section of light on the ground outside it.