Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Unity 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:
    201
    I'm not at liberty to share this information just now. Will let you know very soon.
     
    buttmatrix likes this.
  2. 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
     
  3. konsic

    konsic

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

     
    Last edited: Jan 24, 2019
  4. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    403
    The feature has landed in 2019.2. Look out for
    Contribute Global Illumination
    checkbox and the
    Receive Global Illumination
    dropdown (Lightmaps / Light Probes) in the Mesh Renderer's options.
     
    Adam-Bailey, MAK11, konsic and 2 others like this.
  5. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    230
    Just checked out the 2019.2 alpha and awesome to see it working. I assume it isn't going to be supported with Enlighten (doesn't currently work at least) so might be worth giving a notice to users if Enlighten is selected. Spent a couple of minutes trying to figure out why ambient light wasn't baking into the probes correctly until I realised I hadn't switched to Progressive.

    Super quick and dirty test with a grid of probes and a single 8*4*8 LPPV.

    LightProbeOnly.JPG
     
    Jesper-Mortensen likes this.
  6. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    403
    @Adam-Bailey actually it's meant to work when baking with Enlighten as well and the internal automated tests show that it does. Would be great to get a bug report with your project, even though I don't expect big differences between that and our tests... there is at least one. :)
     
    Adam-Bailey likes this.
  7. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    230
    Just reported it with the title Light not baking into light probes using Enlighten in 2019.2.0a4. I narrowed down the issue to occurring when Realtime GI is ticked in the Lighting panel.

    ProgressiveCPU.jpg Enlighten-RealtimeOFFBakedON.jpg Enlighten-RealtimeONBakedON.jpg

    I'm keen to find some time to test this out in a large environment, having emissive surfaces working without any lightmaps is fantastic.
     
    Last edited: Feb 15, 2019
    Kuba likes this.
  8. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    388
    Hey! Make sure that Ambient Mode is set to Baked, as opposed to Realtime when you toggle Realtime Global Illumination on.

    Also, regarding emissive materials; since Unity 2019.1, we have exposed Global Illumination: None parameter in the material UI. See the screenshot below:

    Unity_yIBHaasgJo.png
     
    konsic likes this.
  9. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    876
    This is interesting

     
  10. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    230
    Yeah, checked that. In the example project submitted there are other light types as well.
     
  11. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,382
    How to use OptiX denoiser? the denoiser option are greyed out.
     
  12. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    876
    I got this error message but lightmapper started anyway. What does it mean ? //2019.1b7

     
    Last edited: Mar 15, 2019
    JamesArndt likes this.
  13. MAK11

    MAK11

    Joined:
    Nov 24, 2017
    Posts:
    11
    Link to Jepser's scheduled GDC Talk about the integration of Intel Open Image Denoiser in Unity 2019.x
    https://schedule.gdconf.com/session...lightmaps-presented-by-unity-and-intel/865250
    Just wish that non Nvidia owners will have a GPU based solution one day. Intel's solution looks good enough for now.
     
  14. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,118
    No need, really. From testing it seems Open Image Denoise is either on par or better than Optix.
     
  15. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,118
    Hey so I'm having an issue with light probes, for quite a while actually.

    It has to do with how I lit my scenes very indirectly and I really like using small emissive meshes. This leads to sometimes the lightprobes missing the light source and it makes them have inconsistent results.

    So for example, here is a very exaggerated example of this issue:
    Probes2.jpg
    It's exaggerated because I went out of my way to maximise the inconsistence in order to showcase the issue.

    Here is another more "normal" example:
    Probes.png

    I can usually work around these, by editing the positions of the probes that look way out of place and slightly moving them, so I can roll the dice on their sampling again and cause them hopefully miss less stuff. The workaround works, but combined with how I can't really just bake the light probes by themselves it makes it kinda slow and painful to fix things.

    I actually did a bug report for this, it's case 1135553 , but I'm not sure if it's a bug or a feature request for "improved sampling light probe sampling".

    I'm guessing this is a side effect of the way the light probes do the sampling, which was probably tailored more for speed?

    As I said, I'm not pushing for this to be a bug, it could be a feature request (and in that case, it's one I'm actively requesting, for whatever's that worth :) ).
     
    konsic likes this.
  16. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    876
    Is it possible to just make global light probes? So, engine would create a grid of light probes across all of prefabs so that user don't have to place them on exact spots.

    I suggested this some time ago as feedback.
     
  17. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,274
  18. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    876
    I was think like in UE4 but for LP. They could be generated in all space and based on distance to prefabs.

     
  19. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,109
    Hi! Thank you for reporting this! The probe sampling does have a problem where sample counts are not respected.
     
    WildStyle69, konsic and AcidArrow like this.
  20. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    201
    That's right. There are slight differences as they were trained against different data, but overall they are comparable in quality. The Optix one appears to produce slightly blurrier/smoother results; that may be good or bad depending on your assets.

    The presentation is here: https://drive.google.com/file/d/1evcgkYLhEpGGNhCPLQgnWY6njrRNERoX/view
     
    konsic likes this.
  21. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    90
    Can OID potentially be used for realtime raytracing or its too slow for it?
     
  22. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    201
    It would very awesome with a single pass AI denoising in realtime! Currently however, AI denoising is nowhere near fast enough for realtime so it is only for offline uses. Denoising for realtime raytracing is very much intertwined with the individual techniques themselves which is one of the main problems of the current generation of RTRT algorithms. In our preview RTRT build we use a per effect joint bilateral gaussian filtering with a temporal buffer. This is an area of active research.
     
    hippocoder likes this.
  23. RigoCL

    RigoCL

    Joined:
    Sep 22, 2015
    Posts:
    7
    Hi, same problem here using just downloaded 2019.1.0f2, mine is:

    [PathTracer] AddGeometry job with hash: f1bf86363eb5f32bc3afcce7b85c6719 failed with exit code 1.

    The problem is this error shows over and over again while "Preparing bake...", I mean same hash is shown thousands of times, so the preparing never ends...
     
    galaskap likes this.
  24. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,109
    This very cryptic message means that some vertex channels might be missing. Do you have the following channels in the failing geometry? Vertex, Normal, TexCoord0, TexCoord1?
     
  25. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    4,257
    I came across this issue today and now I'm wondering if there is any progress or ETA on this?
     
  26. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    32
    Hi Peter, unfortunately the spatially coherent packing has been put on hold due to other issues taking priority. We still want to add it, but I cannot say when or if it will happen. I also responded to your specific question in your own post.
     
  27. galaskap

    galaskap

    Joined:
    Aug 14, 2017
    Posts:
    1
    I've been getting this same message in 2019.1.9f1...I'm on a Mac and get it for both GPU and CPU...Where would we check our vertex channels? I'm using Blender 2.79b and tried exporting just a plain cube but still get this message. I have "Generate Lightmap UVs" checked.

    EDIT: I am using LWRP as well.
     
    JamesArndt likes this.
  28. Gervais54

    Gervais54

    Joined:
    Apr 7, 2016
    Posts:
    22
    Can't use progressive light mode in unity 2019.1.10f when use the GPU the program simply crash and with the CPU I get the following error for all object in the scene

    This project was working correctly in 2019.1.9f

    [PathTracer] Failed to add geometry; mesh is missing required attribute. Please make sure mesh contains positions, normals and texcoord0.

    [PathTracer] AddGeometry job with hash: f8e3c13a656530e92e61ee50e5ea77a2 failed with exit code 1.
     
    galaskap likes this.
  29. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,109
    Select the mesh in the project view, then you can see the channels in the inspector in the bottom of the 3d mesh preview.
     
  30. Stanislawe

    Stanislawe

    Joined:
    Mar 26, 2015
    Posts:
    20
    Any ideas? 2019.2.4
     

    Attached Files:

  31. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,109
    Are you using non uniform scaling on the cube?
     
  32. Stanislawe

    Stanislawe

    Joined:
    Mar 26, 2015
    Posts:
    20
    No, everything is by default and builtin. Important note: this happens if there is a cutout or transparent object near the light source (point or spot).
     

    Attached Files:

  33. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,109
    Hi, I have reproduced this and created case 1183940. Which version of Unity are you using?
     
    Stanislawe likes this.
  34. Stanislawe

    Stanislawe

    Joined:
    Mar 26, 2015
    Posts:
    20
    2019.2.4f1
     
    KEngelstoft likes this.
  35. MafiaMoe

    MafiaMoe

    Joined:
    Mar 24, 2013
    Posts:
    18
    Our scene seems to have contracted some awful disease, blotches of 'miscalculated dots' appear in higher number as we crank up the number of samples. So far we have noted:

    - It only seems to happen in this one room/area
    - Increasing the pushoff helps from 0.001 to 0.01 helps but further increases have no effect.
    - Increasing the samples of any type increases the count of these blotches.
    - Increasing the denoising doesn't fully cover up the blotches (even to highest values)

    upload_2019-9-27_15-50-39.png

    upload_2019-9-27_15-53-23.png

    upload_2019-9-27_15-53-59.png
     
    konsic likes this.
  36. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,109
    Does it happen without the AI denoiser enabled? Or by denoising do you mean _filtering_?
     
  37. AlbertoVP

    AlbertoVP

    Joined:
    Dec 6, 2016
    Posts:
    26
    How can I avoid this problems when a object have before the back of other object?

    upload_2019-10-2_16-31-10.png

    upload_2019-10-2_16-31-28.png
     
  38. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    32
    Hm, I am not sure what it is that you are seeing. It looks a bit like lightmap dilation (at least in the first photo), but that really shouldn't happen there (since the wall is not covered up). A few things to try:
    1. Verify that you have indeed updated the lighting after you last moved static geometry. This is just to make sure that the lighting is up to date. I write this because the first image looks like you baked and then moved static geometry (without rebaking).
    2. Try viewing your scene with the "Texel Validity" debug visualization. For more information about Texel Validity check out the section of that name on this page. If you see something unexpected in this visualization, you may post a screenshot of what you see, and maybe I/we help you based on this.
     
  39. AlbertoVP

    AlbertoVP

    Joined:
    Dec 6, 2016
    Posts:
    26
    I have need change the backface tolerance to 0.3 in a custom lightmap parameters. I see excesive the default value in medium, 0.9 and with the problems that I see in simple scenes.
     
  40. ledbetterMRI

    ledbetterMRI

    Joined:
    May 29, 2019
    Posts:
    4
    Lot's of great info on the Progressive Lightmapper in the Unity Docs, but there's a blind spot about Indirect Resolution that I could use some clarification on.

    On the intro page here: https://docs.unity3d.com/Manual/CPUProgressiveLightmapper.html,
    the Indirect Resolution setting is named and given a recommended value for environment light vs indoor light.

    Yet, on the "Getting Started" page here: https://docs.unity3d.com/Manual/Lightmapping.html,
    the same Progressive inspector window shows this value grayed out as either irrelevant to Progressive lightmapper, or inoperable due to some other project setting.

    So, should I be able to set my indirect texel resolution in Progressive mode? My current project has this option grayed out and I would like to see what changing this value does to the final result (if it's actually relevant). I'm currently using 2019.2.2f1.

    Thanks for your help!
     
  41. MafiaMoe

    MafiaMoe

    Joined:
    Mar 24, 2013
    Posts:
    18
    Yes, I mean changing the filtering options in the Lightmapping Settings doesn't remove the blotches. The different filters only change how the blotches are handled.

    Here is a partial lightmap using a different filter that shows the blotches when using the A-Trous filter instead of Gaussian. The blotches show up in the exact same pattern on the wall as the previous post:
    upload_2019-10-3_2-46-43.png

    Curiously, no 'pure-black blotches' show up with no filtering:
    Lightmap 500 10000 500.PNG
     

    Attached Files:

  42. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,118
    You need more indirect rays, and if you are using 2019, try the AI denoise stuff.
     
  43. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    32
    As you may know, Unity integrates a library called Enlighten which can be used for various lighting calculations. The "Indirect Resolution" specifies the "coarseness" at which Enlighten performs its lighting calculations. Note that this is not necessarily the same as the resolution of a resulting lightmap.

    Enlighten is active when
    1. You use Realtime GI (see checkbox in Lighting window), or
    2. You use Enlighten as the Lightmapping backend (as opposed to Progressive CPU/GPU).
    So if you are using the progressive lightmapper and realtime GI is disabled, then indeed "Indirect Resolution" is not relevant for you. This would explain why it is greyed out.

    Please also be aware that Enlighten is being deprecated and won't be part of Unity in the future (which also mean that "Indirect Resolution" will go away).
     
    ledbetterMRI likes this.
  44. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    32
    That is peculiar indeed. To be sure I understood you correctly: does the dark spots appear only when you enable filtering? This would suggest that it is the filtering process that somehow causes this.

    Does it happen with all kinds of filtering (Gaussian, Atrous, AI) or only some of them?

    To properly debug this it would be helpful for us to a have a minimal scene that exhibits this issue. If you use "Help > Report a Bug" in the top menu, you can attach a copy of your current scene. You may be able to create a minimal scene by iteratively removing objects from your current scene (while making sure the issue is still there). As a potential side bonus, such a iterative process may give you more insight into why this is happening.
     
  45. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    420
  46. MafiaMoe

    MafiaMoe

    Joined:
    Mar 24, 2013
    Posts:
    18
    Yes, it is happening with every filter/denoiser combination available.


    Update: The issue was a couple baked area lights.

    I copied the scene over and started removing items like suggested. Of course I got all the way down to only a handful of items until there were just lights and the offending objects. Finally turning off the two baked area lights atop the walls fixed the issue immediately. Returning to the original scene and turning off just those two lights fixed it there as well.

    Partial light bake after the two baked area lights are disabled:
    upload_2019-10-5_16-34-1.png
    upload_2019-10-5_16-38-1.png

    I can't imagine this happens with every baked area light, but perhaps this issue arose due to the area lights intersecting geometry?
     
    Last edited: Oct 6, 2019