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

Official Progressive CPU Lightmapper

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

  1. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Your input is always valuable and thanks for your collaboration! And for your information, 'lights randomly switching off' issue is already fixed in 2017.3 :)
     
  2. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    From what I can tell, the Baked Tag option will still try to atlas UV pages from meshes with the same tag, is that correct? I want no atlasing whatsoever.

    So let's say I have two meshes that are atlased on to one UV page (with UV islands mixed together on one page), I want to be able to bake that one page (one lightmap) without Unity trying to re-atlas the UVs for me.

    Both meshes will have atlas offset values of [0,0], atlas tiling values of [1,1], and be assigned to lightmap slot 0.

    Is this possible?
     
    JamesArndt likes this.
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    hmm in 2017.2 if we edit lightprobe and trying to rebake the lightprobe it ended up rebake the whole lightmap data. This behaviour will be changed right?
     
  4. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    235
    5.6.4 arrives and... nothing. Pretty please, this is killing me here. In retrospect, I could have burned the hours away using Enlighten, but I /really/ need Mixed Mode lighting to be able to ship several games now. They're just sitting there, dying for the performance boost.
     
    JamesArndt likes this.
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    @Jesper-Mortensen i'm getting spammed by this error when baking using Progressive in 2017.2
    Code (csharp):
    1.  
    2. [PathTracer] AddInstanceProperties job with hash: cf9a3334dabff570af4b20a4c39262c1 failed with exit code 5.
    3.  
    while the baking itself are completed just fine, i'm mostly curious what are those error
     
    Last edited: Oct 23, 2017
    JamesArndt likes this.
  6. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    Can someone tell me how stitch seams work with baking lightmaps?

    It seems from a few tests that it is using the albedo UV for stitching as opposed to the lightmap UV2.

    Basically, we are getting seams along the colour UV map borders which do not exist in the lightmap uv.


    We have double checked the charts in the object maps tab and the mesh is using the correct UV for baking.

    Was just wondering if this is intended or if I should bug it.
     
    Last edited: Oct 27, 2017
  7. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    I am really looking forward to the gpu powered progressive lightmapper. Is there any progress on this? What's the status?
     
  8. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,458
    Yes GPU support would speed things up a lot
     
  9. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    @kemalakay Is this possible with the Progressive Lightmapper?
     
    JamesArndt likes this.
  10. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    I don't think you can do it with 2 meshes as there is no guarantee which baked tag your mesh will be put in.

    However, you can sort of do it with one mesh if you combine them.
     
  11. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    I've tried combining into one mesh in the past, but because it still went through the atlasing process, the UVs were scaled just very slightly, and it was enough to ruin the alignment of the lightmap to the UV shells (especially in large scenes). Combining is not an option for us at the moment anyway.
     
    JamesArndt likes this.
  12. Mark_29

    Mark_29

    Joined:
    Aug 11, 2014
    Posts:
    79
    Ah ok - If you can combine the meshes...... You can create the lightmap UV2 in an external software, which is packed to the full boundary limit, then set the lightmap parameters in the mesh renderer scale to larger than the object size allows. This normally maximises the UV to a full map/tag

    Padding doesn't change in a premade lightmap UV (but to be honest I have never compared texel to texel) - I have just noticed that increased padding in the lightmap settings does not affect a premade uv (unless this is a bug).

    but as you said, even if this works, it probably wouldn't help anyway if you can't combine
     
    Last edited: Oct 27, 2017
    JamesArndt likes this.
  13. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    I wonder if i get threadripper 16 core 32 thread will make baking faster. Will progressive lightmapper utilize it at its fullest? Or should i wait for much more needed gpu support?
     
  14. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Honestly i would go with the Threadripper and i guess 32 threads would be supported ( 100% utilization ) !

    It is pretty easy to utilize any device at 100% in path tracing.
     
  15. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    You might be right, I haven't checked recently. When I tried that a while ago it would always add a tiny bit of padding (or maybe it was just precision weirdness) around the edge.

    But yeah, we can't combine anyway so that option is out. I suppose I could find a way to temporarily combine all meshes in to a new 'bake mesh', do the above process, then apply back to the uncombined meshes, but I'm not going to do that because it's way too faffy.
     
  16. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    I've just tried 2017.2 and lightmap push/pull dilation seems to have broken for me.

    In 5.6.1 my lightmaps look correct (push/pull dilation working), but when I load the same lightmap in 2017.2 there is no push/pull dilation. Which is curious because it seems to do the opposite of what the feature suggests! Any ideas?

    5.6.1
    upload_2017-10-30_14-13-26.png

    2017.2
    upload_2017-10-30_14-13-59.png
     
  17. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    Wow.. I could be wrong, but it's November 2017 and we still don't have support for the shadowmask for progressive lightmapper.

    What's the status with this? Any ETA?

    I am using 2017.2 and if this is only going to be supported on 2017.3, please let us know.
    I just read that filtering on shadow is not working, is it still the case?
     
    Last edited: Oct 31, 2017
  18. YvesAlbuquerque

    YvesAlbuquerque

    Joined:
    Jun 6, 2017
    Posts:
    3
    Valdeco and rczarnowski like this.
  19. rczarnowski

    rczarnowski

    Joined:
    Jan 12, 2017
    Posts:
    3
    Hello,
    An update on back-porting this fix to 5.6 would be much appreciated. The above issue is slowing down the workflow in our Studio since we use baked emissive materials to light our scenes as a workaround. This unfortunately gives us very noisy bakes that take a lot of samples to resolve.
    Thanks!
     
    Valdeco and YvesAlbuquerque like this.
  20. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    235
  21. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Mixed light support is coming?
    Fast light bakes :).. Happy, happy.

    Add this after the above:
    May goodness this is very good.
     
    Last edited: Nov 17, 2017
  22. longgi

    longgi

    Joined:
    Dec 1, 2012
    Posts:
    2
    Don't know if this is asked before.



    The green box is exported with one smoothing group + normal map, and the blue box has split smoothing groups.
    There isn't any problem for the green box when baking with enlighten.
    It seems to me progressive only uses vertex normals for path tracing. or at least with my setup.


    The green box looks fine with enlighten.

    Dont' know if i am doing anything wrong, please help.
     
    buttmatrix likes this.
  23. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    99
    Hi Marky! The progressive lightmapper can only output two lightmap types: the ordinary one ("intensity") and, if enabled, the directionality lightmap. These are the textures/maps that the stitching feature tries to fix up.

    Thus, any seams you get from color/albedo are not intended to be fixed as part of lightmapping.

    You can read more here: https://docs.unity3d.com/Manual/Lightmapping-SeamStitching.html

    This being said, I wonder if it would make sense to try to stitch albedo/color using a similar technique. I will have to think about that :)

    I hope this answers your question.
     
    Lars-Steenhoff likes this.
  24. Valdeco

    Valdeco

    Joined:
    Sep 7, 2014
    Posts:
    11
    WermHat, djarcas and rczarnowski like this.
  25. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    Just upgraded to 2017.2.0f3, had some issues with Enlighten so moved to Progressive.

    Is it meant to eat through 20gb of RAM like candy? My system ends up completely unusable during a bake and for some time after it (as Unity still has a hold on that RAM after the bake is long done). Is there a patch out that fixes the memory leak?
     
    JamesArndt, KRGraphics and buttmatrix like this.
  26. andrewc

    andrewc

    Joined:
    Aug 20, 2008
    Posts:
    180
    I'm using the Progressive Lightmapper in 2017.3 beta. Everything is working well but wondering about a feature.

    I have several object that are marked as not casting shadows. However they still seem to block indirect light in the bake causing dark areas under them.

    Lightmap parameters for transparent appear to only work for real time GI. Is it possible to have objects not block GI rays, either through a shader or other setup on the meshrenderer?

    Thanks
     
  27. WermHat

    WermHat

    Joined:
    Jul 13, 2012
    Posts:
    88
    rczarnowski likes this.
  28. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    235
    Patch 5.6.4p4
    Released: 7 December 2017

    No mention of the progressive lightmapper here. For god's sake, how do you get an actual unity dev to pay attention to the other part of their job? It's not just 'programming', it's also 'keeping your customers informed as to what's going on'
     
    WermHat and rczarnowski like this.
  29. rczarnowski

    rczarnowski

    Joined:
    Jan 12, 2017
    Posts:
    3
    https://issuetracker.unity3d.com/issues/progressive-lightmapper-ignoring-lights-in-a-larger-scene
    Annoyingly, the issue has been 'fixed' since early October. But it is only available in a BETA version of Unity 2017.3...

    In such situation I find it difficult to understand why it's flagged as 'fixed' on the Issue Tracker, especially since it has not yet been ported to any stable Unity version.

    Many patch releases were deployed since the 'fix' so it unfortunately looks like the backport of it has been neglected.
     
    Last edited: Dec 13, 2017
    WermHat likes this.
  30. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Hi there.

    Sorry have been a bit tied up these last few months. The backport for the "many lights" bug is in the queue of backports now. I agree this should have been backported immediately to a shipping version, I am truly sorry that we fumbled that one.

    In general we have a desire to backport everything, however, we need to weight that against improving the area and fixing other bugs. Also, there is a risk of destabilizing the patch releases when backporting large changes, which is something we need to avoid at all costs.

    I would urge everyone to move to the latest stable Unity release asap in order to receive all the fixes we have made and the new features we have added to the Progressive Lightmapper. A little glimpse of some of the finished features:

    2017.1
    • Double-sided GI support
    • Cast/receive shadows flag support
    2017.2
    • LOD support
    • Lightmap Least Squares Stitching
    • A-Trous Filtering (Lightmap Denoiser)
    • Terrain trees affecting terrain lightmaps
    • Push-pull dilation of lightmaps (background fill for all the mip maps)
    2017.3
    • Lighting modes
    • Lower LODs can use both realtime probes and baked lightmaps
    • Unity Falloff
    • Indirect Transparency
    • HDR baked Lightmaps
    2018.1
    • Remove Object Limit
    • Lightmap Overlap visualization
    • Sky Occlusion custom bake (experimental API)
    • Support for Huge Scenes

    On top of this we have fixed a lot of bugs ~190 since September - some proportion in the Progressive Lightmapper. Some were introduced with the above features, but some that have been lurking from the start. With these features and fixes we will remove the "Preview" label from Progressive Lightmapper in 2018.1 as we believe it is ready to be used in production.

    But we are by no means done. We have a long list of both features and performance/quality improvements. A part of this is the GPU support which is under heavy development as we speak.

    Hope this helps clear up the picture a bit. Any thoughts?

    Cheers,
    The Lighting Team
     
  31. BenWoodford

    BenWoodford

    Joined:
    Sep 29, 2013
    Posts:
    116
    Yes yes yes yes yes. Honestly, I do wish that GPU support had been top priority from the start - I don't think anyone would be saying "Gee I sure wish I could bake this lightmap at a 10th of the speed on my CPU!" if GPU baking had been the only thing supported by Progressive.

    But hey, it's on the way, and that's what matters. I look forward to not waiting 2 hours for a bake.
     
  32. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    The reason that we didn't limit the Progressive Lightmapper to run on the GPU is that we can't expect everybody to have a suitable GPU. Looking at the Editor stats only 12% of the users have more than 2GB of video memory.

    Also, the amount of video memory is much less than the amount of installed CPU memory in the typical workstation so that means that you can run into cases where you simply can't bake your scene on GPU (because there's loads of geometry and textures and so on) but it fits nicely on the CPU.

    So in general for us it made sense to build the CPU lightmapper before the GPU one.
     
  33. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Can you explain Unity's level of prioritization of the Progressive Lightmapper in light of the evolving(?) OTOY integration? It seems these two options, while different, would both converge on a GPU-based lightmapper, but with different levels of integration within Unity and quality. In essence, which is the most future-proof option for Unity developers?
     
  34. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,458
    I have a Nvidia 1080 ti with 11 GB memory on the GPU,
    love to see a beta version with GPU support

    I have it running with Nvidia webdrivers, on a MacBook Pro 2016 video card external via e-gpu thunderbolt 3.

    Any one with a serious need for lightmapping is more than likely to invest a GPU that is up to speed and has the memory.

    Please don't forget the Mac even if it's only 2 percent of unity users, thanks
    ( Otoy did say that a Mac version will be made only after they made the pc version )
     
    Last edited: Dec 15, 2017
  35. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,282
    Damn, I need a new graphics card :(
     
  36. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Has that really made in 2017.3? Is it in the current betas/RCs? The release notes for the RC don't mention it.
     
  37. danix

    danix

    Joined:
    Nov 15, 2013
    Posts:
    29
    Hello everybody,

    I've made a thread about artifacts with Enlighten, but nobody replied there.

    The problem is, when I try to bake my shadows with Enlighten, I get artifacts, where objects are intersecting, AO is disabled (image_1 and image_2). There're no artifacts using Progressive Lightmapper (image_3 and image_4), but I need Mixed Lighting, which doesn't work with PLM. It looks like Enlighten doesn't blur the shadows, or lightmap anti-aliasing is not working. I have tried everything in the lightmap settings. I've played around with the Lightmap Parameters, still nothing. This is a test scene, with default cube primitives. Using Unity 2017.2.0 (updated to 2017.2.1f1 - same artifacts). Do you have any advice, how this can be fixed?

    Thanks!

    ELM.JPG ELM2.JPG PLM.JPG PLM2.JPG
     
  38. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    This is a known issue with baked Enlighten. I would suggest to upgrade to 17.3 that is shipping before Christmas. This will have lightmodes support in Progressive Lightmapper.
     
    buttmatrix likes this.
  39. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hey AcidArrow,

    yes, indirect transparency is handled not just in 2017.3, but also 2017.1 and 2017.2 (just tested it on 2017.2). I don't know what went wrong with the release notes, but I can confirm that the code is in these versions.
     
    Lars-Steenhoff likes this.
  40. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,458
    So enlighten won't be fixed, and progressive lightmapper is the future, right?
     
  41. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Our focus now is Enlighten for realtime GI and Progressive Lightmapper for baked GI.
     
  42. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    My team is not directly involved with developing the Otoy plugin so can't say how itegrated it will be and which features it will support. The Progressive Lightmapper is the focus for baked GI in the internal Unity team at the moment and yes it will have GPU support too.
     
  43. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Cool!

    I think you should make sure your fixes are in the release notes. I also noticed that the packing improved (yay!) in 2017.3 and again there's nothing in the release notes. There were also similar issues in the past (in fact I think when the progressive lightmapper first got into a public Unity beta release the release notes again, mentioned nothing).

    I sometimes find workarounds (for example, I was having glass surfaces as not lm static, since indirect transparency wasn't handled correctly) and I may not notice when a fix for something is in. I do read the release notes quite diligently, so I think it's super important that all your fixes are in there.
     
  44. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    Is it eventually feasible to use the Enlighten realtime GI with the progressive lightmapper?
     
  45. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    that is what light modes support(?)
     
  46. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Building new tech for realtime GI is a somewhat orthogonal issue. But yes that is on our roadmap too.

    But lightmodes is a prerequisite for mixing and matching realtime GI with baked GI currently.
     
    Adam-Bailey likes this.
  47. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
  48. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,458
    @Jesper-Mortensen
    Is it possible to acces the A-Trous filter via api?

    Or will you be able to create ipa acces to the filter?

    Thanks
     
    Last edited: Dec 19, 2017
  49. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Do you mean changing to the A-Trous filter via the API or something else?
     
  50. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,458
    To able to use the filter for a custom lightmapper, to filter / cleanup the results of the render on a texture.
    So yes switching to the A-Trous filter via script.