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. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    So for your specific issue you would need full control of the UV creation, so item 3) will be for you.
     
  2. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,930
    Yes! That would be a godsend of a feature.
     
    pitibonom likes this.
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,594
    What does this mean exactly?
     
  4. adpok

    adpok

    Joined:
    Oct 26, 2017
    Posts:
    28
    Im hoping that it either means : every object's uv shell is treated as a single shell that can be placed reducing wasted space. Currently if I have a single object which has multiple uv shells, they only get placed as a group, which invariably means a lot of empty space cant be avoided.

    Or that if i have an oval object, the space in the middle will be utilised.

    Or both..im hoping :)
     
  5. adpok

    adpok

    Joined:
    Oct 26, 2017
    Posts:
    28
    Is there an update on when the cpu utilisation issue going to be fixed? And will it be fixed in 2018.2.8f1? Seriously cant believe a version came out with such an error.
     
  6. WermHat

    WermHat

    Joined:
    Jul 13, 2012
    Posts:
    88
    Any ETA on this? We're stuck on Unity 4 until cookie baking support gets added.
     
  7. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    99
    With spatially coherent packing, Unity will try to place objects that are close together (in the scene) into the same lightmap. This is done to improve locality of reference. For example, if lighting information for all objects in a room is stored in a single lightmap, then all objects can be rendered at once by only loading that particular lightmap.

    On the other hand, if lighting information for the objects in the room is stored in 10 different lightmaps, then we can only render a 10th of the objects at once, then change lightmap, then render the next 10th of objects, then change lightmap, etc. In practice the process is more involved, but I think you get the point.

    Here is a GIF showing the difference with and without spatially coherent packing. Colors indicate lightmap ID.
    ezgif-4-580b7db4ff75.gif
     
    syscrusher, MAK11, Peter77 and 7 others like this.
  8. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,852
    My benchmarks on GPU vs CPU progressive :

    cpu : 3770 gpu:GTX 780
    hr:min:sec
    CPU : 2 hours and 30 min bake time
    GPU: 30 min bake time
     
  9. robinjansen51

    robinjansen51

    Joined:
    Nov 6, 2017
    Posts:
    4
    Hi,

    Today I was baking a lightmap and canceled it while it was preparing (force quit unity). Now I get the next messages in my console and can not get rid of them.. I tried new scenes, deleting project settings, library folder, temp, etc but nothing seems to be working. Of course I also tried to change the lighting settings.

    Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs(1516,90): error CS0619: `UnityEditor.LightmapEditorSettings.Lightmapper.Radiosity' is obsolete: `Use Lightmapper.Enlighten instead. (UnityUpgradable) -> UnityEditor.LightmapEditorSettings/Lightmapper.Enlighten'

    Assets/Editor/x64/Bakery/scripts/ftRenderLightmap.cs(1520,93): error CS0619: `UnityEditor.LightmapEditorSettings.Lightmapper.PathTracer' is obsolete: `Use Lightmapper.ProgressiveCPU instead. (UnityUpgradable) -> UnityEditor.LightmapEditorSettings/Lightmapper.ProgressiveCPU'

    Do you have any idea what could cause this?

    Thanks
     
  10. robinjansen51

    robinjansen51

    Joined:
    Nov 6, 2017
    Posts:
    4
    Btw, also when creating new projects I get the same messages.
     
  11. thefranke

    thefranke

    Unity Technologies

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

    you can get rid of the warning by either replacing the two enum values with their new version or by upgrading the project. Did you perhaps open the project with a new version of Unity?

    Cheers
     
  12. robinjansen51

    robinjansen51

    Joined:
    Nov 6, 2017
    Posts:
    4
    Hi TheFanke,

    Thank you for your response. I did open the project in a newer version of Unity yesterday, but it continued worked after that. After force quiting Unity while the Bakery was preparing stuff for the bake it gave these errors. Also when opening / starting new projects and importing Bakery these errors continued. Until now I have always dismissed the API update dialog. But when I tried to update them, the errors disappeared...
     
  13. thefranke

    thefranke

    Unity Technologies

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

    Bakery is not from our codebase. You need to talk to the author of Bakery to resolve those issues.

    Cheers
     
  14. robinjansen51

    robinjansen51

    Joined:
    Nov 6, 2017
    Posts:
    4
    A sorry wrong thread
     
  15. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Recently upgraded my PC to a Threadripper 2950X - thought I'd share one of the benchmarks I did with lightmapping in this thread, for those who are wondering if they should upgrade their CPU/how well cores scale with lightmapping. Haven't had a chance to test out GPU yet but of course assume it would be even faster.

    TLDR: Well done to Unity on thread scaling in the progressive lightmapper, it's much better than Enlighten!
     
    JamesArndt, thefranke and KEngelstoft like this.
  16. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    Hey,
    I am trying to bake a scene for my mobile game with the progressive lightmapper, but I am not sure about how to get the settings right. Currently I am baking the scene with the these settings: image
    The bake is not done yet (as it takes like 3 days on my Mac mini) but it currently tells me that it baked 82 lightmaps at 1024p assembling 0,64gb, which for a mobile game is way too much. I guess that the best option to reduce the file size would be by reducing the texels per unit (suggestion for outdoor/city scenes would be welcome) or reducing the objects which are baked, but maybe there is something more I can do?
    Thanks, Fred :)
     
  17. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,594
    Reduce lightmap resolution. Also, for really big objects (that maybe are not viewed that up close?) you can select them in the scene and in the mesh renderer greatly reduce the "scale in lightmap" number.
     
    syscrusher likes this.
  18. fred_gds

    fred_gds

    Joined:
    Sep 20, 2012
    Posts:
    184
    Thanks, the "scale in Lightmap" is definitely something I will try.
     
  19. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    are there plans to add light direction encoded as L1 Spherical Harmonics to the Progressive lightmapper? It enables a huge boost in quality to baked lighting, especially when using it as an approximated light source for specular.

    (As seen in Frostbite engine for example and the Bakery GPU lightmapper for Unity)

    *edit: as seen here, not referring to lightprobes but storing L0 and L1 x,y,z for much better directional lighting + indirect specular from lightmaps https://media.contentapi.ea.com/con...-precomputedgiobalilluminationinfrostbite.pdf
     
    Last edited: Jan 15, 2019
    keeponshading likes this.
  20. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    SH are part of GI

    http://fileadmin.cs.lth.se/cs/Education/EDAN35/lectures/Stefanov10-gi-in-games-notes.pdf

    https://developer.amd.com/wordpress/media/2012/10/Tatarchuk_Irradiance_Volumes.pdf
     
  21. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    Lars-Steenhoff likes this.
  22. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
  23. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    I think unity have this before, it was called Directional Specular lightmap, but they remove it. I don't remember why.
    Also it have the same issue as in Slide 77.
    What i'm curious is why unity didn't give us access to use Proxy Lightmap Geo, since this is built in Enlighten features.
     
  24. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    We do have this in our backlog. However, we are focussing first on improving the probe lighting as this has even more potential for improving baking quality. These improvements are both on the authoring side (volumes, auto placement, etc), the feature side (participating probes, env occlusion etc) and the tech side (probe deringing, streaming etc).

    Probes are flexible, you don't need geometry unwraps and they can be arranged in 1D, 2D or 3D.
     
  25. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Hang on, are you talking about the Probes for dynamic object or probes for baked static objects?
     
  26. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    So soon you can have probelit objects fully participating in the GI calculations, making probes far more useful as they can be used for static objects too. In fact you could have a scene completely lit with probes.
     
  27. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ooohhh, now that is looks "Lit"
     
  28. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    604
    EXCITING!!!! Can't wait to hear more about this.
     
  29. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    So taking the approach ReCore used and making it an officially supported lighting method? :D
     
  30. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    They way ReCore used are supported already in unity AFAIK, it called LightProbeProxyVolume
     
  31. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    The main difference is that it will be a fully supported feature to light objects with lightprobes, while those objects fully interact with the GI system, so affecting both lightprobes and lightmaps in the scene. This is a big win for things that don't lightmap well but affect their surroundings like foliage, trees etc. On top you get the benefit of much better directional support as the probes are L2 spherical harmonics.

    Basically, the lightmap and probeset become symmetric as a container for GI.
     
    Reanimate_L, Adam-Bailey and konsic like this.
  32. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    When will this be available as production ready ?
     
  33. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    That sounds good, is it much different to the current trick of giving things a lightmap scale of 0?
     
  34. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    We are aiming for 19.2 for this feature (if everything goes to plan).
     
    Reanimate_L and Adam-Bailey like this.
  35. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Yes, the problem of using lightmap scale 0 in the current system is that the object will not have correct emissive and albedo information as that was previously tied to the lightmapped objects resolution. This is now decoupled so it will work seamlessly now. The UI also reflects these changes so you can pick the GI container for the object and it is not some side-effect of another parameter.
     
    AcidArrow and Adam-Bailey like this.
  36. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    Ah, nice. Really looking forward to playing with it, should be a nice way of getting around a bunch of limitations with the current lightmapping.
     
  37. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Out of interest can you share what those limitations are so I can make sure we meet them?
     
  38. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    Nothing overly particular to Unity. Things you mentioned already like vegetation and smaller props that you want to contribute to the GI but aren't really good candidates for light mapping themselves. Up to now I have been getting around those issues by using lightmap scale 0 and you already addressed how this approach will help with the problems encountered with that approach. :)

    edit: I also imagine it will be good for lighting larger open spaces where you don't want to waste a bunch of lightmap memory on fully lit ground, but want to have some areas underneath shade. Rather than having to break up a mesh into different parts with different lightmap resolution settings, presumably you could just place a higher density of probes in the areas where it is desired?
     
    Last edited: Jan 17, 2019
  39. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    All of you are aware of denoising in the lightmapper right? The short is that you can get smooth bakes with a 1th of the samples, so you can bake out high quality lightmaps much, much faster.

    So in 19.1 we have introduced Optix for CPU Lightmapper, in 19.2 we will have Optix for GPU Lightmapper, and (crosses-fingers) another denoiser that will work on all GPUs and that also works across Mac and Linux as well as Windows of course.

    Use it now in CPU Lightmapper in 19.1 and let me know what you find!

    Enter_the_Room.png
     
    JamesArndt, Total3D, mh114 and 5 others like this.
  40. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,513
    When is 2019.2 planned to go in alpha?
     
  41. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I would say March/April.
     
  42. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Its in alpha now, transitions to open beta end of March.
     
    Lars-Steenhoff likes this.
  43. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995

    Is it possible to achieve realtime indirect lighting with these lightprobes without baking lightmaps?
     
  44. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Depends on what you mean by realtime. The probes have full indirect lighting in them including all the objects that are marked to `contribute to GI` so to all intents and purposes behave as lightmaps.

    Basically there are now two containers for GI: lightmaps and lightprobes. And regardless of the container they contribute to the GI solution in the same way.
     
    syscrusher, Adam-Bailey and konsic like this.
  45. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Please take a look at this project brechpunkt.de/q2vkpt/

    https://github.com/cschied/q2vkpt/
    Maybe some similar solution can be for Unity.
     
    Lars-Steenhoff likes this.
  46. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    Lars-Steenhoff likes this.
  47. MAK11

    MAK11

    Joined:
    Nov 24, 2017
    Posts:
    11
    Is it safe to assume (given that the GPU Lightmapper uses RadeonPro render) that the "other" denoiser will be AMD's upcoming RadeonPro render denoiser which is planned for Q1 2019 ?
     
    JamesArndt likes this.
  48. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    231
    I'm not at liberty to share this information just now. Will let you know very soon.
     
    buttmatrix likes this.
  49. MAK11

    MAK11

    Joined:
    Nov 24, 2017
    Posts:
    11
    Can't wait to hear about it and all the great improvements you & the team have been bringing to the renderer.

    Cheers
     
  50. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Unreal's distance field based dynamic lighting could be very useful in Unity.

     
    Last edited: Jan 24, 2019