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

Light baking process took too long to complete but the result is horrible

Discussion in 'General Graphics' started by ohohgames, Mar 9, 2015.

  1. ohohgames

    ohohgames

    Joined:
    Aug 9, 2014
    Posts:
    23
    I have my machine running the baking process in Unity 5 for a day when I was at work, at the end of the day get back and here is the messy result



    Any idea would be appreciated
     
  2. plasmabazooka

    plasmabazooka

    Joined:
    Mar 8, 2015
    Posts:
    70
    Did you try to reduce value Atlas Size?
     
  3. ohohgames

    ohohgames

    Joined:
    Aug 9, 2014
    Posts:
    23
    reduce atlas size to 1024 doesn't help at all, the baking proccess still take too long to complete
     
  4. RobHannah

    RobHannah

    Joined:
    Dec 16, 2014
    Posts:
    9
    Your texel resolution seems very low at 0.1 per unit.
     
  5. Jonathan-Watkins

    Jonathan-Watkins

    Joined:
    Mar 10, 2015
    Posts:
    125
    I find that setting the Real-time Res to 0.5 looks almost as good as the default 2 but takes way less time to bake and By turning on continuous baking I get a lot faster baking speeds (because it's not baking AO)... 0.1 res makes things look horrible...
     
  6. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    Texel resolution for Baked GI should be 10 or above almost always.

    You can view it in the topleft corner of Scene View > Baked > Show Lightmap Resolution
     
  7. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Please make sure you supply correct UVs. Did you generate UVs or use the ones from the modelling package?

    How does the UV charting view look?
     
    topofsteel likes this.
  8. ohohgames

    ohohgames

    Joined:
    Aug 9, 2014
    Posts:
    23
    The models were created using 3dsmax.
    Here are severals picture of UV charting, also the scene consist just several models but it still take about 20 - 40 minutes to do baking






     
  9. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Thanks! Your Realtime GI UVs look fine. Please have a look at the UV overlay that is shown in the Baked Intensity view - it is that UV set that looks like it is busted (and needs to be generated).
     
  10. ohohgames

    ohohgames

    Joined:
    Aug 9, 2014
    Posts:
    23
    Sorry I didn't get what you mean by "busted".
    So how should I do to fix it ? It would be great to have some references so that I can look into to get a better understanding about this.
     
  11. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    I am not sure the UVs are broken (that was what I meant by busted), but it looks like it. If you look in the Baked Intensity view for an object, you can tell if it looks correct or if it is a mess. Maybe post a screenshot? You generate lightmap UVs in the model importer settings by checking "Generate Lightmap UVs".
     
  12. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    You also need to show the UV Charts view like so - notice the top-left:
     
  13. ohohgames

    ohohgames

    Joined:
    Aug 9, 2014
    Posts:
    23
    I found the problem, I forget to set Generate Light-map UV in model import setting, I always made this mistake before as I don't use this light baking stuff so frequently. Here is the UV chart



    But still, the process take too long to complete for a small scene and even it can not complete with ton of errors that I have no clue where and what to fix.

     
  14. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    I have had a few bakes take a long time but those were for larger scenes. Since your scene is small and the errors mention "failed to open file" do you by any chance have anything on your machine that maybe locking any files (especially newly created ones). Some antivirus programs or automatic backup programs (i.e. carbonite) lock files and might be interfering with the baking process. Something to check at the very least.
     
  15. ohohgames

    ohohgames

    Joined:
    Aug 9, 2014
    Posts:
    23
    I don't have any antivirus except the default window defender one. I did several times cancel or force quit unity while the baking process is doing its job, just to mention if it give some clue.
     
  16. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,887
    I wouldn't say your scene was "small". What time are you expecting? Look at the Sceneview > Baked overlay. The bigger the squares the less time it'll take, but the shadows won't be as sharp. You can also turn off precomputed GI if you don't need it.

    If it's a 1st-person game then you will need detailed shadows (high Baked Resolution), but if it's an RTS then you could reduce the the Baked Resolution.
     
    Last edited: Mar 22, 2015
  17. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    @ohohgames those error messages are not something you are likely to be able to fix yourself. Please file a bug report so we can fix the underlying cause.
    You might be able to work around it by increasing GI Cache size.
     
  18. ohohgames

    ohohgames

    Joined:
    Aug 9, 2014
    Posts:
    23
    Thanks for your ideas, it lighten me up somehow about the baked overlay.

    @KEngelstoft Even I clean GI cache in Unity Preferences, the bug still exists