Search Unity

Official Progressive CPU Lightmapper

Discussion in 'Global Illumination' started by Kuba, Feb 2, 2017.

  1. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
  2. Ganindu911

    Ganindu911

    Joined:
    Jul 21, 2016
    Posts:
    7
    How to fix this........??
     

    Attached Files:

  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Didi you generated lightmap uv for sponza model ?
    If not, select it from Project files and check Generate Lightmap UV checkbox from inspector and press apply.
     
    Ganindu911 likes this.
  4. Ganindu911

    Ganindu911

    Joined:
    Jul 21, 2016
    Posts:
    7
    yes i was did it but that problem does not solve
     
  5. Ganindu911

    Ganindu911

    Joined:
    Jul 21, 2016
    Posts:
    7
     

    Attached Files:

  6. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    In my test it works fine
    I think your problem is still Lightmap UV
     
    Deleted User and Ganindu911 like this.
  7. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    Yes, lightmap UVs in that model are self overlapping and generally really bad. You have to enable lightmap UV generation in the mesh importer for it to work at all.
     
    Ganindu911 likes this.
  8. Ganindu911

    Ganindu911

    Joined:
    Jul 21, 2016
    Posts:
    7
    hey aliyeredon...i watched your all videos and downloaded all....
    i will try again to do that
     

    Attached Files:

  9. Ganindu911

    Ganindu911

    Joined:
    Jul 21, 2016
    Posts:
    7
    hmm ok thanks jesper i will try again
     
  10. Ganindu911

    Ganindu911

    Joined:
    Jul 21, 2016
    Posts:
    7
    i did this using unity 5.5
     

    Attached Files:

  11. Ganindu911

    Ganindu911

    Joined:
    Jul 21, 2016
    Posts:
    7
    thanks guys.....finally its worked.....!!!
     

    Attached Files:

  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Has anyone had luck using this for transmissive surfaces such as rice paper? I am trying to light my sanctuary level which only has a single directional light that is outside, but the room is enclosed and I have these screens for the light to filter through... and the light isn't filtering it...
     
    thefranke likes this.
  13. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I'm am wondering what I can do to improve light mapping performance.

    I have an i7-5280 processor and 8 GB of Ram. Will going up to 16 GB help? My scene gives ETA of 10 hours!
     
  14. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    If your system is paging then of course perf is going to be terrible. Right now the lightmapper only scales to moderate scenes (see known issues https://unity3d.com/unity/whats-new/unity-5.6.0), but fear not we are working hard on this right now and should have a fix available soon.
     
  15. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hey KRGraphics, if you want to use a texture or color for transmission you need to set it up with a shader keyword called _TransparencyLM.

    Here's an example snippet you can refer to:
    https://gist.github.com/thefranke/04e1424d7e45c7c054a8656bbf603fce

    The colors will be used for transmission (i.e. as a multiplier) rather than for transparency.
     
  16. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    OK, great. I'm going to bump my memory up to 24 GB or 32 GB.

    FYI, the Unity page doesn't show any hardware requirements for memory...I'm sure it depends on what you are developing (PC, mobile, etc) and the type of game you are making. Some kind of guideline would be good.

    https://unity3d.com/unity/system-requirements
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I am using Alloy so I would have to ask these guys about that...
     
  18. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    My point was that rather than buying more memory it makes sense to wait for the upcoming update that would make the progressive lightmapper use less memory in the first place. I would still say that 8GB is on the low side, if you intend to work on large levels.
     
    buttmatrix likes this.
  19. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    After seeing the performance of my brothers laptop bake light 4x faster than my desktop (my desktop has a much better CPU)....I went out and bumped up the memory for my computer to 24 GB.

    I am working on moderate levels so this helped me with that as well...
     
  20. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    Ok, but the intention is that we fix this on the code side though. We know exactly what to do and have folks all over it.

    But regardless, your money isn't wasted, extra memory is always helpful.
     
  21. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    My test with 16 and 32 RAM:

    16GB RAM : 26 min
    32GB : 29 min

    Same scene, same system. 4790K cpu

    Baked in resolution 14.

    If you want to bake with high resolution , you need more RAM
     
  22. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    Looks like the less RAM the better? It is highly scene dependent, you need to find the sweet spot where a 16GB system starts paging and the 32GB system does not to see a big difference in speed. With Sysinternals Process Explorer it is quite easy to do exactly that.

    Basically, we currently allocate a lot of memory upfront, memory for all the lightmaps that we are eventually gonna bake. The new system will instead maintain a reasonably sized memory buffer and bake the lightmaps it can fit in memory and then free some memory move on to the next lightmap(s). So the system has a fixed number of "slots" for lightmap baking.

    This will be 1) faster and 2) require less RAM in the machine. It will avoid situations where the systems starts paging. And it will be spending all of the CPU on the lightmaps that are currently "live" so would be no slower than now.

    The only drawback is that the number of "live" lightmaps at any one time depends on your installed RAM. So if you have not alot of RAM and you are using "View Prioritisation" some lightmaps will not update right away beacuse it can't fit them in memory. We will have to pull in the UX team to try and build a nice workflow for those situations. Especially the situation where you move the camera and want to see it baking another area - in that case we will have to unload some lightmaps and load some others into the aforementioned "slots" (ideally without discarding work).
     
    spryx and UnityLighting like this.
  23. Amir-Ward

    Amir-Ward

    Joined:
    Jan 26, 2015
    Posts:
    30
    The progressive lightmapper is great. Fixes up a lot of problems I was having with enlighten. But I'm getting a lot of errors in the console.

    One of the error's I get when doing a bake with the new progressive mapper:

    [PathTracer] AddInstanceProperties job with hash: 6e630b99635e8c5d28b765207d79a077 failed with exit code 5.

    I get over 1000 of these and even when the mapper has finished baking I still get them.

    Also, if I reload the current scene (i.e pressing 'restart level' in my game) the lightmap disappears and the whole scene is black apart from my sprites.

    And one other problem I am experiencing is an error that occurs when I'm turning on and off a spriterenderer:

    Dynamic batching: index buffer destination is NULL (first IB byte 0 count 0 first vertex 0 offset 0)
    Dynamic batching: index buffer source is NULL (first IB byte 0 count 0 first vertex 0 offset 0)

    I can't share the project as it is over 5GB but thought I should bring these errors to the attention of the team. I've rolled back to 5.5 and am wrestling with enlighten again in the mean time. Can't wait until the progressive mapper is reliable enough to use in production.

    My details:
    - macOS Sierra 10.12.4
    - 3.2ghz i5
    - 8GB DDR3
    - Nvidia GT 755m 1024mb
    - Using the latest unity version: 5.6.0f3
    - Target platform iOS (baked GI no realtime)
     
  24. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I there guide that is available for using the progressive lightmapper? There are certain objects within my scene that stay black no matter what options I choose.
     
  25. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    So currently we don't support large levels with the lightmapper, we are working on refactoring some code such that it will scale well. So the error you are getting could be related to that but I can't be sure - what is the system memory load like when you see this error popping up? It would be great to get a copy of the project so QA can go through it and we can analyze the scene and figure out if there is a bug lurking?
     
  26. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    The way the progressive lightmapper is used is almost no different than using the Enlighten lightmapper. Have you made sure those objects are lightmap static? Also we currently don't support quad geometry and if you mirror objects by scaling them negatively that won't work either (although both of these are fixed internally but not shipped yet).

    Can you share a picture of whats going on? Ideally showing the lighting panel and mesh inspector in the shot?
     
  27. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    The gameobject is marked lightmap static. I've uploaded a couple of screenshots

    I also changed the Light parameter to change the "Backface Tolerance " to 0.

    Note: I've done several full bakes.
     

    Attached Files:

    Last edited: Apr 7, 2017
  28. fildax

    fildax

    Joined:
    Apr 7, 2017
    Posts:
    37
    Hi,
    Lightmapper makes really nice results.
    I have problem with indirect intensity though.
    When I set it up to higher than 1 ( for example 5) and bake, it looks fine, but after I close editor and open and load scene again, visually its like it was set up to 1 ( even though its still 5 ).

    with englighten it works just fine.

    Maybe problem is on my side?

    Forgot to mention its working ok on static, but problem is with dynamic objects.
     
    Last edited: Apr 7, 2017
  29. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Are all of the cores used for rendering?

    I have a dual 6 core cpu (12 total cores) and 96gb ram. Is there an automatic setting that this is all utilised?

    thanks
     
  30. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    It should use them all. Look at cpu usage while it's running.
     
  31. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    It could be that the lightmap that this object is in has not been updated yet. In the global maps tab you can find the lightmap associated with the selected object. Its probably another lightmap than the one that contains the surrounding objects that have been lit. It will eventually get to that lightmap.

    We will eventually change the packing such that objects are packed with spatial heuristic - that way its much more likely that objects near each other are in the same lightmap (or a small subset). Right now the objects are scattered across lightmaps.

    Also you have 59 1K lightmaps that's a bit heavy for now. We need the memory improvements before we can scale to larger levels.
     
  32. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Is the packing going to be improved/tweaked in general?

    AFAIK, it's still bounding box based, and I don't think there's still any reason for it to be like that (it was introduced to facilitate bake selected). It also seems to be unable to rotate the uvs (by 90 degrees) to pack them better. I'm guessing because of the directional mode, but not doing it for non-directional as well is a bit weird. In short, the packing in Unity 3.5 used to be much better sadly :/
     
    mh114 likes this.
  33. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
     

    Attached Files:

    Last edited: Apr 7, 2017
  34. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Just for reference:


    3.jpg
     
    buttmatrix likes this.
  35. RafaLL92

    RafaLL92

    Joined:
    Jan 21, 2017
    Posts:
    1
    Hi there! Let me say that the new Progressive lightmapper is great!
    I am having a weird issue though:

    Some of my lights in the scene won't bake (as if they were switched off). If I then move the problematic lights just slightly and rebake, then they wake up but some other random lights switch off instead. Is that a known issue? Or maybe I am missing something with my set-up? Thanks!
     
  36. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    Will this also fix the problem for inverted objects? Or is that considered a separate bug?
     
  37. BORODA

    BORODA

    Joined:
    Mar 19, 2013
    Posts:
    11
    Will final gather be available as an option sometime? Because my scenes seem to be having a lot of noise for both enlighten and progressive. Enabling final gather in enlighten removes it pretty much completely.
     
  38. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    You can use the filtering to get rid of the noise. The problem, currently, is that the filtering is kinda basic and it gets rid of details as well all noise. They're planning to introduce smarter filtering options in the near future though.
     
  39. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    I am fixing inverted objects at the moment, should arrive in a patch release soon[TM].
     
  40. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    It's not really the final gather that makes it "better" - it is the denoising filter. We have implemented the A-Trous filtering kernel for the progressive lightmapper. This is just around the corner. Should land in an upcoming patch release.
     
  41. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    having many issues with "progressive"
    totally not helpful:
     
  42. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    We are looking into the UpdateinstanceTransforms issue.

    Non-triangle topology issue has been fixed and is on its way to a patch release. You can work around the issue by disabling 'Keep Quads' on the mesh importer.
     
  43. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    thank you @Jesper-Mortensen
    that's good news. but when I said "not helpful" I meant that it doesn't show which mesh had issue.
    I have several hundreds of meshes in scene and to go through all of them checking which one keeps quads is a time sink
     
  44. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    That makes sense. I try to go the extra mile and add mesh links when I report errors, but with this one it is rasterizing a lightmap that could have hundreds of different meshes in it. So showing an error with a huge list of links might not be super useful. Besides you should never see this one again once the fix lands.

    But I appreciate that it is annoying and we should ideally always link to the offending mesh/instance/object.
     
    Almakos likes this.
  45. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    @Jesper-Mortensen just wanted to say you are doing god's work on this thread. Thanks a lot!
     
  46. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
  47. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Nice work, eagerly awaiting release! We use tons of inverted objects in our environment to manage less meshes, so it would be good to get progressive lightmapper working with them. :)
     
  48. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Is this possible to get these type of the indirect shadows?

    Rove3D (CG path tracer):
    Revo3D.jpg
    Progressive Lightmapper (baked with 10.000 sample counts):
    PL_3D.jpg
     
    Last edited: Apr 24, 2017
    KRGraphics and buttmatrix like this.
  49. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    In 2017.1, mesh renderers have a flag under 'UV charting control' to 'ignore normals'. Can I get any additional information on this?
     
  50. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    I've always wondered by Enlighten never bakes out these types of shadows - I assumed it was a texel resolution or irradiance quality issue. Lightmass handles this type of shadowing pretty routinely.

    Has anyone done any comparison tests with the advanced filtering settings?
     
    Last edited: Apr 24, 2017
    UnityLighting likes this.