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

Question Unity takes more than 45 hrs to bake a simple scene

Discussion in 'Global Illumination' started by w34edrtfg, Oct 5, 2021.

  1. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    72
    It's so weird. It never took me more than 2 hours to bake a scene but i'm having troubles on baking this one.

    Baking process is "stuck" at step 7/10 "Transport Light", barely progressing a 1% per 8 hours. After leaving it baking for 5 days at least 8 hrs/day it is still at 68%.

    CPU: i9 8gen
    GPU: 1080 GTX
    Unity version: 2020.3.17f1
    Graphics API: WebGL 2.0 [OpenGL ES 3.2 in editor]
    Build focus: HTML5
    Lighting Settings:

    I'm quite sure it's not actually using the GPU because CPU is 100% and GPU at 5%.

    I also got the following error:


    About the scene:
    I just bought https://assetstore.unity.com/packag...n/polygon-city-low-poly-3d-art-by-synty-95214 and clicked on "Static" checkbox over all items in the demo scene. I believe i've rendered way more harder scenes before :S



    ¿What's going on?¿Why is taking days to bake that scene?
    (I will also appreciate any notes on Lighting settings for WebGL build)
     
  2. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    419
    Hi. Did you enable Generate Lightmap UVs toggle in the import settings of the models?
    Also, there are a lot of objects in this scene, so making everything Static is not a good idea. For small objects you should use Light Probes
     
  3. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    72
    TY very much for replying!

    I've checked and yes, all assets (that i clicked) seem to have Generated Lightmap toggled:


    Damn it!
    I set them to static because i wanted to use occlusion culling.
    So you don't recommend setting them to static?
    Will oclussion culling do something if no objects are set to static?
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,025
    Increase Max lightmap size to something normal (1024?)

    Greatly reduce lightmap resolution to something like 1.

    Disable Realtime Global illumination unless you really want it for some reason.

    Disable Progressive updates.

    Then it should be bake-able even with CPU.

    I have no clue why GPU baking isn't working properly.
     
  5. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    if models are complex or lots of overlapping uvs a bake can take longer also
    however your scene does not look high poly and Synty is a good developer

    if you have a NVidia card and working with lots of baked projects i strongly recommend you look at an asset called Bakery as save your self a lot of pain
     
  6. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    72
    Okey!
    - Res lowered to 1
    - Disabled realtime GI
    - Disabled progressive updates
    - Switched to 1024 lightmap
    - Manually removed the "nvidia" package from manifest.json
    Aaaaaaaaaaaaaand something changed because now it went to the GPU!



    It has finished in just 23 seconds now!

    Ty for the info! I didn't want to add extra assets to do something that i (stupidly?) expected Unity to do in a proper manner.
     
    Last edited: Oct 6, 2021
    DEEnvironment likes this.
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,025
    Cool! You could bump up the lightmap resolution a bit now if you wanted, so things look better. Say a value of 4 or so and it should bake in a couple of minutes.
     
  8. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    72
    I'm actually happy with the result :)
    What bothers me now is that after going static+occlusion culling+no real time GI the fps dropped from 70fps to 30fps and lower hmm.
    I will have to check on profiler what's going on.
     
  9. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    419
    Static toggle is just a quick way to enable all the features of the Static drop down menu. To enable only the oclusion culing, click on the triangle next to the Static toggle and enable Occludee Static for small objects and Occluder Static and Occludee Static for large objects.
    upload_2021-10-6_19-25-35.png
     
    Last edited: Oct 6, 2021
  10. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    72
    (you probably don't care but) i remembered that i had those lines set somewhere:

    Code (csharp):
    1.  
    2. QualitySettings.vSyncCount = 0;
    3. Application.targetFrameRate = 30;
    4.  
    So it seems that until now there were somewhow being ignored. I've changed it to 60 and framerate went up to 60 :)
     
  11. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,108
    welcome to lightmap baking.
     
  12. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    219
    If (NVIDIA)
    {
    buy(Bakery);
    }
     
    DEEnvironment likes this.
  13. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    233
    60$
     
  14. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    219
    Test unity latest beta. Looks like a big leap in usability...
     
  15. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,150
    Just buy it. It's so far beyond the built-in lightmappers that it's not worthwhile trying to save money unless you just make games for fun in which case use realtime only. There's an add-on that you can get for it to be able to preview everything in realtime which is very valuable too. It's another $35 on top of the $55. Still very worth it though.
     
    Last edited: Oct 12, 2023
    ontrigger likes this.