Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Progressive CPU Lightmapper

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

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Well, actually the automatic unwrapper should do the job - the point is that they are not always comparable to custom made UVs but you should be fine as there is a stitching algorithm as well.
    However, have you tried the A-Trous filter. This is the more advanced one - which is doing real denoising and not like the gaussian which is more of a blurring filter.
     
    Last edited: Apr 21, 2018
    JamesArndt likes this.
  2. Sentionaut

    Sentionaut

    Joined:
    Apr 27, 2015
    Posts:
    10
    Oh, yes, it usually does the job. On previous versions, it would sometimes get buggy and skip certain objects, on which situation the only solution was to manually unwrap those specific meshes, but it did the job in general. However, since it's being so slow and erratic now, I was just wondering if the lack of UVs is being part of the reason... I hope not, honestly.

    And thank you for the advice, but yes, I have tried the A-Trous filter. It still looked bad on my scene, so I switched back to Gaussian, which is the default. Just in case.
     
  3. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Funny just to test things out to make sure I had no illusions about Beast vs. the new lightmapping I installed 4.72 and imported in my same race track as I have in 2017.3. The Beast lightmaps the entire scene every time in less than 2 minutes with high quality lightmaps. No issues I can see. Sure I don't get fancy global illumination or raytraced bounced craziness, but I get solid looking occlusion and shadows in less than 2 minutes at very high quality. Awful to move into 2017.3 and try to lightmap the same scene. Takes at least 10 minutes and the quality looks blurry and awful. If I bump up the resolution my entire system will freeze up out of memory. I've been a Unity user for about 10 years now and this is the worst I've seen the Editor lightmapping workflow. Both lightmappers not working correctly or inefficiently and worse Unity keeping us in the dark on how to easily and quickly get bakes that look great and in minutes, not hours. I did see another thread where a Unity developer linked a workflow web site that was several pages long with thousands of lines of obscure settings and directions to reduce bake times. It's just like off the chart insanity at this point to expect every day users to go through that "pipeline".

    A YouTube video demonstrating my current lightmapping issue:



    Below is a description of my problem:
    Using Unity 2017.3.0f3 on Windows 8.1 Pro (Progressive Lightmapper)

    I brought these geometry pieces into Unity with the all of these asphalt track sections on a single UV atlas, with the geometry all separated for culling purposes. Unity sees them as individual pieces of geometry (as they are), but I need a way to tell the lightmapper they are all on one atlas. The UV set I created in 3ds Max has all of these geometry pieces fitting on one texture and is optimized for little wasted texture space. I am applying both a custom Baked tag and a System Tag to these specific pieces of geometry using a custom Lightmap Parameters file for said objects. Adjusting the "Scale in Lightmap" on these objects is making no difference in their layout or packing. The packing and layout appears to be being altered somewhere in the process (not preserving my 3ds Max layout).
     
    Last edited: Apr 21, 2018
  4. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Upon close inspection the UVs all appear to be flipped in the Y axis and scaled in Unity to different resolutions, even though they all share a "Lightmap Scale" of 1.0. On the left are the baked UV charts within Unity and on the right are my UV2 coordinates laid out in 3ds Max. Again I do not have "Generate Lightmap UVs" checked on the FBX import settings in Unity, so no idea why scaling and flipping is occurring on these same UVs in Unity.

     
    Last edited: Apr 21, 2018
  5. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
  6. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    My main issue is that Half-life 1's lightmaps are way lower resolution, but have no bleeding issues. See these screenshots.

    See how smooth and bleed-free these HL1 engine lightmaps are. No bleeding at all, even though they must be very small resolution. There are some issues where the geometry has been cut, but that's all.
    hl1.PNG hl12.PNG hl13.PNG

    Compared to Unity:
    unity.PNG unity2.PNG

    Luckily, I'm always making realtime games, so it hasn't been an issue.
     
    JamesArndt and dadude123 like this.
  7. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    I noticed that as well. It's horrible I tried adjusting padding size but it just won't help.
    I wonder why thats such a huge problem in unity when hl1 can look better with lower res :/
     
  8. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    39
    I don't mean to derail the progressive lightmap thread any further, but I noticed you were having trouble with this and would like to give some suggestions. It looks to me like these road segments are separate mesh objects (Asphalt_01, Asphalt_02, etc), but you've packed their UVs together in 3dsmax as if they're one object. When Unity builds a lightmap atlas, it will automatically pack lightmap UVs together per-object, so your UV2 layout from 3dsmax is going to be overwritten (and become less efficient due to the empty UV space each object has to accommodate the other separate objects). To fix this, consider merging these objects together as one in 3dsmax (forcing Unity to use your packing layout, but removes the culling you want), or unwrap each object with their own separate UV2 layout and let Unity pack them for you in the lightmap atlas.

    Also, I wouldn't obsess too much about baked UV charts. It's basically showing you how the lightmapper is reading the geometry in your scene to sample GI (based on data like vertex normals and UV seams, etc). It has nothing to do with packing and tags. If you want to know which objects are sharing the same lightmap atlas, use the Lightmap Indices debug view.

    As for the UVs being flipped on the Y axis, it might be caused by the up axis being converted between 3dsmax and Unity (Unity uses Y, 3dsmax uses Z). It shouldn't really matter for lightmaps.
     
    Last edited: Apr 23, 2018
    JamesArndt likes this.
  9. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    As an even more extreme example, here is a Quake 1 map (to be fair it's using updated tools, but still amazing that a game built on 22 year old technology often has less baked lighting issues)

    https://twitter.com/SimsOCallaghan/status/988115982223839232
     
  10. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Yeah that's why I was using the "Baked Tag" on these geometry objects via custom lightmap parameters, the documentation says it will force these objects onto the same lightmap and that's not happening. I need to keep the geometry separated for culling purposes so not really a workaround for that. I did pack these separate geometry objects onto one texture atlas in the hopes Unity wouldn't automatically shift and scale them around. I would intuitively think if forced on the same lightmap texture they would maintain their orientation and scale. I guess I'm coming from the workflow with Beast for baked lighting. It maintained the UV structure of imported UV2 coordinates.
     
  11. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Using Unity 2017.3.0f3 and I cannot for the life of me find the docs for Lightmap push/pull dilation and or find the toggle or settings for this in the Editor.
     
  12. Sentionaut

    Sentionaut

    Joined:
    Apr 27, 2015
    Posts:
    10
    Just on update on my previous post.
    I've been baking with Progressive on the other levels of the game, and it seems that timings are not different with this lightmapper, BUT it does look jaggy and noisy. The one that's going way too slow is Enlighten.
    After three days, I managed to bake the lightmaps for the scene I mentioned with Enlighten, which looks better than Progressive right now. I've had to bake the other scenes with Progressive today because they're bigger and I can't afford to spend so much time on them. Fortunately, in these scenes the camera is placed farther away from the camera, so the bad quality that Progressive is giving me it won't be so obvious.

    In any case, none of the lightmaps I have could be used for a final version of the game. We're still some months away from shipping, but I'm worried this won't get fixed soon enough.
     
  13. adpok

    adpok

    Joined:
    Oct 26, 2017
    Posts:
    28
    tbh i just hope they really look at the baking tool in the context of actual production, because the UV layout is poor, the shadow mapping is poor, and you cant rely on updates when you are in production. We are stuck at a certain version because newer updates have fixed one issue but broken another.

    I've certainly not enjoyed the process.
     
    Lars-Steenhoff likes this.
  14. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    yes the uv layout is not optimised
     
  15. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I understand that in 2017.3, the PLM should bake tree shadows on the terrain....but it's not working very well for me. I want to do a Distance Shadowmask, but the baked shadow on the terrain is a huge dark area encompassing the forest, rather than per-tree shadows. See screenshot. I've tried various settings, I've set the tree model to Lightmap Static and Scale in Lightmap to 0, no help. I've increased the Lightmap resolution, no help -- and even here set at 25, it should be plenty good enough.

    The ginormous shadow is the main issue, but the tree billboards also don't have any lighting information, so they look bad (either too dark or too light, depending on the scene) as billboards, and then very visibly get lighting information when fading to tree models on approach.

    Am I doing something wrong?

    Screen Shot 2018-04-24 at 3.22.02 PM.png
     
  16. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    I don't remember having any options like that.
     
  17. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    They were touting this as a feature of 2017.2 some time ago. Not sure if it was exposed or not now that I think about it, says it's "background". I don't why it wouldn't be exposed as it appears to be an important "padding" setting for lower mips.

    Lightmap background (push-pull dilation)

    https://blogs.unity3d.com/2017/10/12/unity-2017-2-is-now-available/

     
  18. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Did you see my post above? For some reason all the scale in lightmap settings are EXTREMELY high in this version of Unity causing extremely long bake times and large maps. Set them to 0.02 or 0.1 and see if it helps.
    You got to do this on all models being baked for some reason I am pretty sure it's a bug with the scaling.
     
  19. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Frankly I'm very surprised to see zero responses or activity from any Unity staff. This is a core pinned thread for the Progressive Lightmapper. So many issues I've seen brought up in here and no feedback to get folks and myself the answers we need. My own personal question is very simple: Why are my geometry sections not respecting the baked tags and why are they being moved and flipped and scaled?
     
  20. adpok

    adpok

    Joined:
    Oct 26, 2017
    Posts:
    28
    As far as im aware, scale doesn't quite work like this, its like a tug of war between scale and Lightmap resolution.

    eg. Object bake scale of 1 and lightmap res of 10 is same as object scale of 0.5 and lightmap res of 20, or an object scale of 2 and lightmap res of 5.

    To be honest its all dependant on how many lightmaps you are able to bake as the scale relates to how much UV space an object is allowed to have. Best bet is to look at which object needs to most resolution and work from there.
     
    JamesArndt likes this.
  21. adpok

    adpok

    Joined:
    Oct 26, 2017
    Posts:
    28
    do your materials have 'double sided GI turned on' I was having nasty shadow and bake issues when it wasnt on my trees.
     
  22. adpok

    adpok

    Joined:
    Oct 26, 2017
    Posts:
    28
    yeah i found the A-trous didnt help either, im having to blur shadows in photoshop.
     
  23. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    I remember that. Blender has an option for how big you want the margin to be after baking ambient occlusion, so that no black leaks in. We should have these options exposed too.

    I get nothing like that image you posted. I still have tons of black in my lightmap. There are some of the larger coloured squares, but not the small ones around the edges, which is what I need.

    My lightmap looks ok (not perfect) with Point filtering, but when changing to Bilinear the seams are obvious. It's not doing the correct dilation like in that image. If I zoom into the Object Maps > Baked Lightmap, there is some tiny margin around the UV's, but not enough. I just retried it in 2018.1b9 and it's the same lightmap... Increasing the padding in Generate Lightmap UV's doesn't help.

    I don't see why they can't do a basic dilation like Blender's... It doesn't seem hard.
     
    Last edited: Apr 26, 2018
    JamesArndt likes this.
  24. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    That's why I was asking about. I've spent a ton of time looking at my charts, my baked maps and every other aspect over the last few weeks. I see none of this dilation occurring so I wanted to ask if it was removed or hidden or what's going on with it? I just do not understand why their cannot be a built-in lightbaker for mobile or lightweight stuff. Something as simple as what Beast was. I'm not looking at Beast with glittering eyes either. I just reinstalled 4.72 to test out bake times, quality and quantity of maps, UV layouts, etc. Now I provide my own lightmap UVS so I can't speak for Beast's auto UV layouts, etc...but overall the experience is light years beyond Progressive Lightmapper. Now I know this makes it sound like Progressive is a step backwards. I don't know anymore. With Beast bake times are very, very fast. Quality is good for mobile. It bakes minimal maps out, at least for me. What takes 24 maps in Progressive, bakes about 6 or 8 Beast. Now I don't want to go back to Beast, but can't Unity just implement a simple light baker that works similar. Nothing super fancy with bounces and all of that jazz, just straight occlusion and shadow baking? Take in my UV2 lightmap UVs and don't rotate them, scale them or auto place them, just leave them as they were authored.
     
  25. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    I have noticed another problem - lack of light bouncing. The light won't bounce well through this vent, even at 4 bounces.

    Enlighten then Progressive:
    progressive1.PNG progressive2.PNG

    I assume this is what "Light Transport" in Enlighten does. Unreal also has a result like Enlighten, but Progressive fails to do it even when ramping up Albedo/Indirect Intensity boosts.

    Because of the GPU support, will it be updated with more advanced light propogation?
     
    JamesArndt likes this.
  26. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Thanks for the tip, but hmm, those options are gray/disabled on my tree materials. I've checked a number of different trees' materials, they're all grayed out. They're all Tree Creator trees, FWIW.
     
  27. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    Can we get an example on how to bake and use the occlusion probe please? There's really no example how to use it :/
     
    JamesArndt likes this.
  28. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    Try adding more bounces.
     
  29. Fallc

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    I'm not sure if the issue is known,

    but I'm unable to bake a large scene with an atlas resolution of 4096. Unity starts baking with 90% CPU load, then drops to ~15% after a minute. No ETA shows up in the status bar, just "Baking...". Im using 2018.1.1f1
     
  30. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Any update on the GPU lightmapping? Or estimated time
     
  31. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Could you try downgrading to an earlier version?
     
  32. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    @Jesper-Mortensen Any chance of getting replies to this and other issues reported here lately?

     
  33. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    That's not an option. I couldn't build the project in 5.6 using the progressive lightmapper despite it being faster. Now, with a completed scene, it just churns endlessly.
     
  34. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I use PL and three realtime point lights on terrain.
    When player's camera is around where 2 point lights collide, there happens a blackout: sudden very short black screen.

    1. If I rotate the player's camera for some angle , point light is shut off. If I rotate it again, light is back on. As if light is culled based on an camera angle.
    2. Why is this happening and how to avoid it?
     
    Last edited: May 24, 2018
  35. ArthurianRedux

    ArthurianRedux

    Joined:
    Mar 7, 2014
    Posts:
    2
    Hi Unity Lighting Team!
    I have a quite big scene in my project, about 5000x5000 units.
    There is a heavy artefacts definitely related to direct part of light.
    As soon as you move about 2000 units from origin, and rotate it even a little bit, it appear more and more.
    No problems when rotation is (0,0,0)
    Very easy to reproduce, with standard cubes or any geometry with lightmap UV.
    Please help!!!
    screen1.jpg
     

    Attached Files:

  36. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Try to remove directional light. I also have similar artifacts. But, if I remove directional light, they're are gone.

    What pipeline are you using ?
     
  37. ArthurianRedux

    ArthurianRedux

    Joined:
    Mar 7, 2014
    Posts:
    2
    Artefacts are coming from directional light, doesn't matter how it rotated. I'm using very standard pipeline, differed, distance shadow mask, progressive lightmapper, mixed lighting.
     

    Attached Files:

  38. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    So I realise I'm quoting a really old post, almost a year ago, but I also submitted this bug (case 936693) a year ago and at this point I'm kind of losing hope it will be fixed.

    I see in the bug tracker that it's still open, although, weirdly, I see no entry for it on the issue tracker, so I really don't know if it's going to be fixed. I did see something about supersampling in release notes at some point, but I'm guessing it was for something else?

    Because it still happens in 2018.1.4f1 and it's kind of a drag.

    I mean on the bright side, it has turned the baking process into an interactive one, where I hunt down problem areas with prioritise view first so they are clean, but after doing this for so long, I just wish I could just click Generate Lighting and it would just produce the results it should.

    And I mean.

    prioritizeview.png

    Left is with prioritize view and right is with a normal bake. Both with the same settings. Both finished baking.

    I mean admittedly those both don't look great since the texel density is kinda low, but the left is pretty clean and passable and in the normal textured view it looks just fine. While the right side looks needlessly noisy and jittery and it stands out in the scene, and not in a good way.
     
    JamesArndt likes this.
  39. Pr0x1d

    Pr0x1d

    Joined:
    Mar 29, 2014
    Posts:
    46
    Something is wrong with 2018.2.0b9 progressive gl.

    I am trying the book of dead and I cant bake the scene with progressive and its saying that I need to use progressive to have tree occlusion.

    So I made new scene put static plane in there.
    upload_2018-6-20_13-29-14.png
    (Put the smallest setting possible I think)

    It was baking 5+ min, in 2018.1 I can bake it in a second, whats wrong with this version? plese help
     

    Attached Files:

  40. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Hey! I was not able to reproduce this issue on 2018.2.0b9 using the exact same setup. Does this also occur when you create a new project?
     
  41. Pr0x1d

    Pr0x1d

    Joined:
    Mar 29, 2014
    Posts:
    46
    Just tried new project and it baked like in around 10s so I dont know what was added in the book of dead project that slowed progressive lightmapper.
     
  42. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    Hey devs. I realise you are super busy, but:

    It kind of feels like GPU PLM is strategically ignored/not talked about, and fixes for the CPU PLM are sparse (and new features a pipe dream).

    So all I'm saying: An update on what's going on would be nice, even if it's bad things.
     
    scvnathan and ArchVizPRO like this.
  43. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    453
    Also at Unite Berlin for Progressive GPU was not announced any ETA. :(
     
  44. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Agree, the current underutilize CPU of PLM are bothers me, it make the lightmap baking quite slow
     
  45. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    We have some fixes for CPU underutilization in the Progressive Lightmapper coming in 18.2. Likely in one of the early patches. And we are working hard on the GPU Lightmapper, have hit some snags with stability on certain common cards but we are working to resolve that. We are mostly feature complete except from some minor options. Plan is still to release GPU PLM this year if everything goes well.
     
  46. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Yes, this bug is very annoying. We did find something that we believed was the cause but after QA restested on this level it was still reproducing. It is on our radar though, rest assured we will get to it.
     
  47. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Here's my take in the gpu lightmapper:
    my plan is to buy a new video card when the gpu lightmapper comes out, what ever the ones that works best at that time is the one I will get.
    the times it saves me can easily justify the cost of a new card.

    Would be nice if it comes out this year at least in preview, even when only working on a few cards. final stable version can come later.

    Thanks
     
  48. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    Thank you for the updates, much appreciated.
     
  49. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi, I suspect you are getting a lot of invalid lightmap texels because the terrain lightmap texels are seeing many backfaces from the trees. There are a few things we can try to isolate the issue:
    - What is the backface tolerance value set for the lightmap parameters for the terrain? What happens if you use a higher tolerance value?
    - Have a look at the texel validity scene visualization mode? is the area with the wrong shadowing marked as invalid during baking?
    - Does using double sided GI for the tree foliage make a difference?
    - Can you please provide a screendump of the generated shadow mask texture?
     
  50. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    (you mean lower, right?)