Home Unity

Light Baking in Unity 5.5

interpolator
Offline / Send Message
jStins interpolator
I'm on a VR project using Unity 5.5.2 and am experimenting with lighting solutions. I have been able to get some good results with baked lighting, but am also running into issues here and there, mostly with the bake hanging as objects are added. I have been able to work through most of the problems, but I'm also seeing a lot about light baking being 'broken'. Threads like this:

https://forum.unity3d.com/threads/gi-stuck-on-bake-indirect.313933/

https://issuetracker.unity3d.com/issues/gi-gets-stuck-on-bake-indirect-when-precomputed-realtime-resolution-is-equals-0-dot-2

So what are all your thoughts? Is light baking in Unity 5.5.2 a viable solution or is it actually 'broken'? Or will it be better to pursue an external baking solution? The project is targeting fairly high end PC specs, would precomputed realtime GI be viable? Not sure if that is any more stable than baked?

Thanks!


Replies

  • RyanB
    We used Vray in 3DS Max for lightmaps and it worked perfectly.
  • jStins
    Offline / Send Message
    jStins interpolator
    Thanks @RyanB. What led to your decision to bake outside of Unity? Did you find similar issues to what's mentioned in the linked threads I posted? I assume that light probes for character lighting are a not going to work if baking outside of Unity, correct?
  • MikeF
    Offline / Send Message
    MikeF polycounter lvl 19
    Rite now the lighting in unity 5 is the #1 thing that makes me consider other engines. There's a lot of unpredictable behavior and the bake times are ridiculously long compared to beast in unity 4. 

    If you're developing for vr, realtime/pre-computed GI is not going to be your ideal option for most situations. A single room type setup might be doable, but beyond that you'l need some really good optimization to get it running at 90fps without dropped frames so baked is your best bet (even with 10x series gpu hardware).  

    As far as the hanging when adding objects i'd recommend disabling the auto-bake functionality if you haven't already as that seems to cause a lot of problems when you're rapidly changing your scene.

    Its certainly workable, but  if you're in the early stages of a new project i'd say its wise to start doing some tests in engine to see if it'l deliver what you need. Another thing to keep in mind is that unity 5.6 looks to bring some good improvements with the progressive baking system so it might start to get better soon.

    RyanB: I've started to look at moving in the direction of using mental ray for my bakes, but i'm a bit concerned about the back and forth between 3d package and unity. Are you assembling everything in 3dsmax, baking then exporting, or exporting the scene from unity when you're ready for a bake? 


  • RyanB
    jStins said:
    Thanks @RyanB. What led to your decision to bake outside of Unity? Did you find similar issues to what's mentioned in the linked threads I posted? I assume that light probes for character lighting are a not going to work if baking outside of Unity, correct?
    Vray is fast and high quality.  After a few days of experimentation, another artist and I got some decent renders.  He continued working on it and made it even better.  I honestly haven't used lightprobes much, but I think you could do something with the lightprobe coefficients?  https://docs.unity3d.com/400/Documentation/ScriptReference/LightProbes-coefficients.html
  • RyanB
    MikeF said:
    RyanB: I've started to look at moving in the direction of using mental ray for my bakes, but i'm a bit concerned about the back and forth between 3d package and unity. Are you assembling everything in 3dsmax, baking then exporting, or exporting the scene from unity when you're ready for a bake? 


    Each section of the game is assembled and lightmaps are baked in 3DS Max.  There's no back and forth since we have to export an FBX anyway.

    If you can't work on your scene's lighting outside of Unity, then you are stuck with whatever they give you. 

    Mental ray is pretty dead.  Maya is shipping with Arnold.  I would probably use Blender Cycles before I would use mental ray. 
  • MikeF
    Offline / Send Message
    MikeF polycounter lvl 19
    righton, thanks for the info. So with everything being assembled within 3dsmax, are you still able to take advantage of things like static/dynamic batching, prefabs etc? 
  • jStins
    Offline / Send Message
    jStins interpolator
    @RyanB Thanks for the info. We are currently planning on using Maya LT, but I think I'll push a bit more for a full license or two as a plan B so an external bake is possible.

    @MikeF Cheers, thanks. We are definitely early in the dev cycle and I've been able to get some good results in Unity. However, the bake times are pretty significant, even with a relatively simple scene / optimized bake / lightmap settings. I actually just finished a bake that took about ~1 hr. Unity failed to write lightmaps for a couple objects. I'm concerned that while it's workable now, it won't really scale to the whole project efficiently. 

    I'd also second Ryan's comment on Mental Ray and take a serious look at Arnold. I recently used it on a project and really liked the workflow and results. It wasn't a game project, so I have no baking experience with it yet. It plays with the same PBR logic that's common in game dev and the learning curve wasn't too bad. 


  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 11
    I will say that baking seems to have slightly improved on the time-wasted front in the newest updates. But they are still lacking a lot of basic features (no padding for lightmaps?). Have shied away from the effort baking lightmaps in another app would cost, though ;)
  • Chimp
    Offline / Send Message
    Chimp interpolator
    Next version of unity is bringing a progressive baker which you might be interested in. Enlighten is also slightly better afaik. 

    I've actually had no problems with enlighten so long as I use it properly - for a start you want to ensure that while working, you're using appropriate quality settings per gameobject, and appropriate settings globally for the context (i.e not a stupidly high quality bake while you're still iterating - last i checked it defaults to a reasonably high quality). And that you're not using it on terrain.
  • jStins
    Offline / Send Message
    jStins interpolator
    Thanks @Chimp. I had a hunch that a lot of the shouting about light baking being 'broken' was due to incorrect settings and it not being as straight forward as people would like. That said, I'm definitely looking forward to trying out the new progressive baker. Even the ETA info would be a help as I'm currently looking at a bake, wondering if it's frozen or if I just need to be patient. 

    What are the per gameobject settings you've found to be most important? I'm guessing 'scale in lightmap' and whether the object is marked 'important', but maybe there's more that I'm missing. 
  • HAWK12HT
    Offline / Send Message
    HAWK12HT polycounter lvl 12
    https://unity3d.com/learn/tutorials/topics/graphics/introduction-precomputed-realtime-gi

    Hey hi, Hope the link above helps. Lighting being broken has been resolved for most parts yet I get few issues time to time. However broken stuff at times come with how you have (a) model the mesh (b) does it come with hand authored lightmap UVs in line with Unity's mentioned method on how to unwrap for lightmaps and (c) single large mesh (like full house) or modular (assemble house inside Unity) 
    In my experience there is no one final solution / steps to get the job done, You have to deal with pros / cons depending on your approach like for me Flatiron bakes save memory that lightmaps use though biggest draw back is any change to geometry in scene and do whole bake again. For modular scenes assemble everything, do changes and re bake within Unity this is also my preferred method. 
Sign In or Register to comment.