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

POLM - GPU Lightmapper - NLM denoising test !

Discussion in 'Assets and Asset Store' started by Vagabond_, Feb 5, 2016.

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    I guess it should run if the shaders are translated ok by Unity's side. There might be some specific thing that need to be written especially for Metal compute shaders though. I remember that there was something in the code which was fully supported by Metal compute shaders - i think was something about textures... I am NOT sure, was a long ago, but i do not have access to Mac Book and i couldn't give it a try !
     
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    It seems to be detecting GPU support, I will try to run some test


    Screen Shot 2017-11-22 at 12.48.16.png
     
  3. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Nice. Let me know !
    It says emulated GPU, so something might not work out of the box !
     
  4. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    >3. Release date is not yet clear, even though i would like to be in a matter of days, but will probably be in a couple of >weeks, may be if i manage to do all that's currently planned !

    I know some of us will cringe but I believe you should bump the price up when it includes the lightmap, in order to be around for a long time. 45-80$ will do it without any problem.

    >The new interface looks very clean! good work

    agree!
     
  5. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Hi, small update on the work !

    The Acceleration Structure was re written and currently gives me a difference of 2:45 minutes

    Old demo ( the one that is available to download here in the thread was rendered in:
    11:21 minutes

    With the updated BVH, the same scene is rendered in:
    8:34 minutes

    How much is this - around may 20-25% increase in overall speed !
     
    blitzvb and Lars-Steenhoff like this.
  6. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    very nice news, rendering faster is great
     
    Vagabond_ likes this.
  7. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    I want an interior benchmark with this :D
     
  8. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Yes, i would like too, but i will have to build one. Have no access to an interior scene !
     
  9. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Aliy did one recently to Test VRay.
     
  10. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
  11. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
  12. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
  13. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
    512x512
    GTX960
    4300 samples
    Area Light + Emissive Materials + Spot lights + Sky
    photo_2017-11-24_11-34-39.jpg photo_2017-11-24_11-34-42.jpg photo_2017-11-24_11-34-44.jpg photo_2017-11-24_11-34-47.jpg photo_2017-11-24_11-34-48.jpg
    photo_2017-11-24_11-34-39.jpg
    photo_2017-11-24_11-34-47.jpg
     
    Last edited: Nov 24, 2017
    Gametyme and petersx like this.
  14. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
  15. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    The interior scene is really nice.
    Lightmapping looks good except the few glitches.

    Meanwhile, some updates on the work !
    The lights contribution in now fixed and they work as expected with intensity of 1 !
    I did find an issue which makes the shading flat when lightmapping. This is when you rasterize on the GPU. Will have to fix it. Using the CPU rasterization has smooth shading but lacks the border texels which are however filled later using dilation after bake is done ! Will improve it as well !
     
    Last edited: Nov 24, 2017
  16. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
  17. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    please post render times and machine specs for tests, this gives a nice indication of performance improvements for each version
     
  18. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
    Bake time is related to a few factors:
    1. Resolution
    2. Sample count
    3. Ambient Occlusion

    1. You can use minimum resolution possible until you are reached to a desired quality

    2. You must wait until noise be cleaned. So

    all indirect lights has a lot more noise compare to direct lights:
    Direct Light sources: Spot,Point,Directional
    Indirect Lights: Area ,Emissive materials,sky light,GI

    to reduce bake time you can use 180 degree spot lights (with high custom shadow radius) )out side of the windows to simulate fake indirect lighting casted into the room. This is the main solution in all UE4 indoor lightings (because UE's indirect lighting is not supported completely)

    Currently only Progressive Lightmapper and Enlighten supports Shadow radius for Spot lights. So i have used same scene in 2 minutes using Progressive Lightmapper. But used only Area and sky lights in POLM and baked in 3-10 minutes. But the result is more correct and is not fake

    So POLM must support shadow radius for spot lights to get fastest baking and reducing noise

    3. AO is an real bake time killer (will increase the bake time) in all CG Renderers or Lightmappers.

    https://forum.unity.com/threads/vray-vs-plm-vs-octane-vs-polm-vs-arnold-in-lightmapping.505099/
     
    Lars-Steenhoff likes this.
  19. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    I remeber using turtle for maya ten years ago and amient occlusion was pretty fast, I wonder what techique that was
     
  20. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    The AO in POLM as addition to the GI requires one additional ray to be spawned, so it shouldn't be that noticeable. I even think that i can use the first ray intersection information for AO calculations and if i manage to do it, the AO will be almost for free. Will look into this !

    P.S. the free AO when doing GI actually works, jest need to test it a bit more.

    I will send you guys ( to the BETA Testers ) an email with the new beta may be in an hour !
    I am just preparing the package now !
     
    Last edited: Nov 25, 2017
    Shodan0101 likes this.
  21. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
    No no no
    Beast or Turtle (both are same) was about 1.5~2x slower than without AO
    VRay also is slower using AO
     
    Shodan0101 likes this.
  22. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Hi, just another small update on what's been happening to the tool. This is work in progress!

    What's new and improved:

    1. The UI is redesigned and should be improved more later - Look below !
    2. A bug with the GPU rasterizer which made the objects look faceted was fixed
    3. Lights now have proper color (intensity) contribution to the final image
    4. The BVH structure was improved with around 20-25% increase in the speed ( it all depends on the scene of course )
    5. Added additional intensity option to the IBL
    6. Added option to the lights - to cast shadows or not
    7. Currently, the Ambient Occlusion when baking Global Illumination is calculated for free and does not affect emissive objects

    What needs to be improved yet:

    1. The post processing blur algorithm, while it blurs the lightmaps pretty nice, it makes some edges darker
    2. Should try to improve the rasterization algorithm eventually in order to hide better some of the seams
    3. Some more work should be done on the Lights. They are yet not sampled the best way.

    POLM__0_97_3_Beta.png
     
    Last edited: Nov 25, 2017
    UnityLighting and Shodan0101 like this.
  23. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
    My errors when using Per Object Baker on start (Lightmapper works fine):
    Code (CSharp):
    1. Kernel 'BakeGI' not found
    2. UnityEngine.ComputeShader:FindKernel(String)
    3. POLM.<BakeObject>c__Iterator0:MoveNext() (at Assets/POLM/API/Editor/POLMOB.cs:106)
    4. EditorCoroutine:update() (at Assets/POLM/API/Editor/EditorCoroutine.cs:30)
    5. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    Code (CSharp):
    1. UnityException: FindKernel failed
    2. POLM.POLMOB+<BakeObject>c__Iterator0.MoveNext () (at Assets/POLM/API/Editor/POLMOB.cs:106)
    3. EditorCoroutine.update () (at Assets/POLM/API/Editor/EditorCoroutine.cs:30)
    4. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:249)
     
  24. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Hi, in email i noted that it will probably not work because i need to change some things. I will fix it but meanwhile will be good if i can get some feedback on the Lightmapper.

    I guess in a couple of days will get "Per Object Baker" to work with the new changes !
     
  25. mgrugl

    mgrugl

    Joined:
    Mar 1, 2017
    Posts:
    22
    Hi, I’d be very interested in testing the beta, and sharing findings and results. How can I sign up for this?
     
    ScoobyNooby and Lars-Steenhoff like this.
  26. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,794
    Latest version is much faster:


    photo_2017-12-01_04-20-48.jpg photo_2017-12-01_04-20-51.jpg photo_2017-12-01_04-20-52.jpg
    photo_2017-12-01_04-20-48.jpg
     
    Vagabond_ and blitzvb like this.
  27. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
    Have you considered switching to bluenoise for your random vectors? http://momentsingraphics.de/?p=127
    Slapping a different 64x64 of those in your RGB slots might significantly improve the visible sampling, and decrease the needed bake times for a reasonable result.
     
    Lars-Steenhoff likes this.
  28. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    That blue noise is very cool!
    thanks for sharing
     
  29. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    I now about this and that it is currently very modern to use, but have to look if it is possible to integrate into a path tracer !
     
    Lars-Steenhoff likes this.
  30. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    Feedback about the GUI:

    Polmbase.cs
    Please change line 267
    mainLabelStyle.fontStyle = FontStyle.BoldAndItalic;
    into :
    mainLabelStyle.fontStyle = FontStyle.Bold;
     
  31. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Hi, may just ask what is the reason you suggest changing the style ?
    It is something that is not working for you or you just do not like the italic style ?

    In general i will think of even improve the label a bit mode !
     
  32. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    Italic. It's not used anywhere in the unity interface and it sticks out in a way I don't like :)
     
  33. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    :) ok i will keep this in mind !
     
  34. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
    All you should have to do is change your random vectors texture, I'd bet. ..Right?
     
  35. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Not really, i gave it a try and seems the r and b values are the same. In POLM random vectors are generated using a Uniform Point on Sphere generation method. Blue noise is used for some other things but i do not think you can generate random 3D direction vectors !
     
    blitzvb likes this.
  36. mgrugl

    mgrugl

    Joined:
    Mar 1, 2017
    Posts:
    22
    I just tested the beta for the first time, and used it on some architectural models. Vagabond, you have created a game changer. I will tell all my students to purchase your asset once it has the Lightmapper. They are all Unity beginners. I am an intermediate user at best. Lightmapping has been a complicated issue to explain them, and with CPU only, also very time consuming. This is finally a simple to use solution that creates excellent results for what we do. Thank you!
     
  37. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    Just ordered a 1080Ti, because of this tool :)
     
    Vagabond_ likes this.
  38. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    Is there a way to bake to 2k with a 16 GB Ram system?
    I'm getting out of memory errors with the example scene
     
    Last edited: Dec 3, 2017
  39. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Hi, i am glad to hear that you like the tool : ))) Hopefully will serve you well in teaching and not only : ))) !
     
  40. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    I am having this error after some time of baking light maps. Did not try 2K because the data could not fit in the memory of the GPU i am using. Optimizing memory usage is in the list !
     
  41. layola

    layola

    Joined:
    Aug 6, 2013
    Posts:
    94
  42. mgrugl

    mgrugl

    Joined:
    Mar 1, 2017
    Posts:
    22
    Hi, I have two questions about the beta Lightmapper:
    This one is likely because I am missing something. Baked geometry seems to respond differently to dynamic lights, e.g. one I use as the sun. Dark areas, those opposite the direct light, never get really dark, as they would with non lightmapped objects. Even if I turn the direct light off, make the scene totally dark, the lightmapped object seems to be lit. What could that be? Is there any way around it?
    Will a new version allow the atlasses be saved in a custom folder? Right now they get saved in the Assets root folder, which when baking many objects creates a bit of a mess there.
    Thanks in advance for any help!
     
  43. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Hi, contacted you in PM for more information !

    Sure, this should be available in the next beta !
     
  44. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    Is there a way to choose GPUs ?

    I have a nvida and an ati card in my Mac and don't know which one unity is using
     
  45. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    I don't think Unity gives you such option ! I thinks this should be set from the driver settings if not mistaken !
     
  46. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    Also it says emulated using metal and not showing the GPU name.
    and because its Mac there is only one way I can think of and that is to connect the monitor to the card thats fastest.
     
  47. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,465
    Looking forward
     
    Last edited: Dec 3, 2017
  48. BinaryLegend

    BinaryLegend

    Joined:
    Aug 10, 2015
    Posts:
    21
    Hi @Vagabond_! My team and I would love to test the experimental GPU GI baker in our late-in-production game, hopefully as soon as possible. We are currently assessing all options, as the Progressive Lightmapper takes way too much RAM usage.
     
  49. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    Hi, POLM is yet in early stage of development and it is currently unreliable in production projects. It will require some more time. Depending on how the work on it goes i may consider release it as an "experimental" update to the previous version!
     
    blitzvb likes this.
  50. BinaryLegend

    BinaryLegend

    Joined:
    Aug 10, 2015
    Posts:
    21
    I'm aware that it is still highly experimental, but would still love to test it on actual production scenes of varying size and complexity. If the results are good and we decide to use POLM for all our lightbaking, you can of course list us under your customers/games that use POLM. I'm getting a little desperate to find any kind of solution :p