Search Unity

baked/mixed lighting: missing shadows for moving objects?

Discussion in 'Unity 5 Pre-order Beta' started by chrismarch, Nov 12, 2014.

  1. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    318
    What is the recommended way to have both baked global illumination maps on static geometry in a scene, as well as moving objects with real time shadows in beta 13?

    When I set all the lights in my test scene to Baking "Mixed", the (non-static, moving) player character meshes do not cast shadows. When I set the Baking of all the lights to "Realtime" the player character meshes cast shadows as expected.

    What exactly is light Baking "Mixed" supposed to do?
     
    Last edited: Nov 13, 2014
  2. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    318
    clarified text/title, tested with beta 13 (same issue)
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,876
    I haven't been able to confirm it, but I believe Mixed is broken. It should produce shadows, but no dynamic GI.
     
    chrismarch likes this.
  4. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    652
    Yeah it worked like this for RNM lightmaps in unity 4 as well. I'm just using the same old workaround that I've always used.

    Have two directional lights, one set to pure realtime, the other set to pure baked but with 5% intensity and bounce boost of 20.
     
    Sep200 and chrismarch like this.
  5. Kubold

    Kubold

    Joined:
    May 10, 2012
    Posts:
    339
    Any outdoor scene with buildings and trees, would kill the framerate with two lights like that... :( There MUST be some solution. I mean, in games with far camera view, like Farcry, Assassin's Creed, or GTA V, I have shadows near and far. I have specular and normal maps near and far. Shadows are dynamic, working for static objects and for skeletal meshes and it doesn't kill the framerate. I really hope Unity 5 will just copy other engines solutions... I want to make bigger games, not only Android platformers, with graphics taken from year 1995.
     
    Gekigengar likes this.
  6. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    652
    The baked only light is has zero cost at runtime! It's just baked into the lightmap texture.
     
  7. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    For b13 there isn't feature parity with Unity 4's dual lightmaps yet (AFAIK). I'm guessing it is on its way via directional lightmaps at some point on the beta roadmap.
     
  8. Kubold

    Kubold

    Joined:
    May 10, 2012
    Posts:
    339
    Hmm, I actually managed to have dynamic objects casting realtime shadows along with static objects casting baked shadows (using "Mixed" option on the directional light). It does work for non-directional and directional baked lightmap, but not for directional-specular (seems like a bug).

    However - the static objects of course, don't cast shadows on dynamic objects then (because they are baked). So, if you have a vast open world, the only solution is casting realtime shadows as far as you can see (sometimes many kilometers). And that just kills the framerate. Or, you can bake everything, but say bye bye to realtime shadows - your character, when walking from full sun, to a dark cave, will still be fully lit by the sun (because there are no realtime shadows).

    You also could use lightprobes to light the character, but he will still cast full shadow from the sunlight, even inside the cave. And the lightprobes lighting looks really bad, especially when half of the guy is in the cave, and half outside.

    All and all, old dual-lightmaps was a pretty good solution. Realtime shadows up to 20m in front of the camera, and baked shadows, that don't take much CPU power, further on. Ok, it's obsolete now, but I just can't figure out HOW to make a good lighting in an open world in Unity 5, with realtime and crisp shadows, and good framerate.
     
    Last edited: Nov 16, 2014
    Gekigengar and neonblitzer like this.
  9. AustinRichards

    AustinRichards

    Joined:
    Apr 4, 2013
    Posts:
    321
    I would love to see what someone from the UT has to say about this.
     
  10. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    226
    Im sure till end of beta they will work out some solution for this, although you can use realtime shadows only, as most games do with big view distance, its not that big problem, but of course not few kilometers.... Look at arma3, this is game with really big view distance, and it has realtime shadows only, and you can set them max 200m, and it looks great anyway.... No that big deal with shadows imo. Also, you think far cry and gta have big view distance ranges? hehehe funny. It just illusion, really cheap illusion.
     
  11. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    318
    This was the bug I was running into as well, thanks. I've submitted a bug to Unity.
     
  12. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,825
    Personally, I wish they would keep the old light mapper and the dual lightmaps as an option. Not everything needs to be ultra-realistic. And it sure was way faster to use.
     
  13. Kubold

    Kubold

    Joined:
    May 10, 2012
    Posts:
    339
    I'm just shooting examples, I didn't really do any research on GTA. Look, visible shadows on maximum 200m is not enough, because what, a distant mountain will NOT cast a shadow on the small town beneath it? The town will be fully lit, and suddenly magically will become dark in shadows in front your eyes, when you walk closer? That's nonsense.

    I have nothing against lighting everything with realtime shadows. I have something against a massive fps drop it causes in Unity 5, in comparison to old, dual-lightmaps solution ;)

    Imagine you are making a plane simulator. You are in the hangar, on the ground. You want realtime shadows and lighting, when you roll out of the hangar, to bright sun, you want the roof of the plane casting shadows when you turn and the windows letting light through etc. Then you start and fly 1km above the ground, your view distance is like 25km... And you want those mountains casting shadows, because you can fly there and actually get in to those shadows. And the fps should be ok with it...
     
    Last edited: Nov 19, 2014
  14. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,089