Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Enter the 2020.2 Beta Sweepstakes for a chance to win an Oculus Quest 2.
    Dismiss Notice

Progressive Lightmapper vs Enlighten vs Lightmass

Discussion in 'Graphics Experimental Previews' started by LightingBox2, Feb 1, 2017.

  1. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    PLM is just good for preview of lightmap and find best setup for scene. After finding best setup you can use Enlighten instead. The result is good and baking is much faster with proper setup.

    How can i get best setup with fastest baking ?

    1. Outdoor:
    * Set lightmap resolution to 3 in Lighting window
    * select Terrain game object on the scene and set Lightmap Scale to 1 in Lighting section
    * Set Lightmap Parameters to Default-VeryLowResolution on lighting window
    * Press Bake

    2. Interior
    * Set scene resolution to 14
    * Select important object like Sofa and Pillow and set Lightmap Scale to 10-30
    * Set Lightmap Parameters to Default-VeryLowResolution on lighting window
    * Press Bake


    My latest comparison on Lightmap Parameters with Final Gather and AO:
    Default-VeryLowResolution : ~10min
    Default-HighResolution : ~2-3 hours
    PLM : 3-4
    hours
    Gif comparison:
    Webp.net-gifmaker (3).gif
     
  2. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    ^are you saying here that you think Enlighten is better and faster than PLM for lightmap baking?
     
  3. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    No about quality. But baking is faster in very-low preset compare to high sample counts in PLM to reduce noise.

    Also Enlighten has lots of light map uv seams . its unusable in some scenarios.

    And finally in outdoor scenes with trees(double sided faces), PLM is unusable because makes black areas around trees.
     
    buttmatrix likes this.
  4. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Today i have compared unity PLM with unreal lightmass to find differences and limitations, the results:
    1. Unreal lightmass was limited very much on indirect lighting . You can see spot lights behind the windows on all UE demos. Because UE indirect intensity is very limited. i also read about this on UE answers site.
    photo_2017-06-01_00-06-22.jpg

    So how UE demos are whole bright?
    The answer is exactly Post Effects. you can see in below image thats how post effects (specially Auto Exposure) make scene brighter:
    2.jpg

    And finally i want to tell you that all UE demos are just beautiful models and textures :
    note: Unity only has Skylight, Unreal has a lots of spot lights. Also unity indirect shadows are similar to offline renders
    photo_2017-06-01_04-11-54.jpg


    And unity lightmap size comparison:


    1024vs2048.jpg
     
    Last edited: Jun 1, 2017
  5. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Holy S*** I just realized that lower shot (with the plants) is Unity!? WOW!

    So you're saying that is literally only the Skylight and no other lights??
     
  6. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Yes an white color as skylight (is not IBL)

    4K renders downscaled to 1024*768 (aliasing problem )
    See all screenshots
    http://imgur.com/a/mpPjP





     
  7. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Stunning. What are the render times vs. what quality level? Could the render times be brought down with some efficiency? What do lower quality settings get you in quality vs. time?
     
  8. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Baked in 10 min with 4790k cpu
    Resolution 14
    Lightmap size 1024
    Lightmap Parameters high
    Sample counts 1000
    non-directional mode
    Lightmap scale 10x

    Quality is depend on your models and scene structure. For example if your scene had noise on far parts from light source, you may needs to increase Sample Counts to 3000-10000. In this case 10 min needs 1-3 hours to complete baking

    Also if you want to bake with maximum shadow resolution, you may needs to bake with 2048 lightmap size. In this case 10 min needs 1-10 hours with 3000 sample counts

    Some times you may want to bake with ultra maximum quality with 4096 lightmap size and 10000 sample counts. In this case you may needs 64GB memory and 1-3 days baking. In this mode quality is comparable to CG renders

    If you want unreal level quality, you can bake in 3 min with enlighten with very-low preset
     
  9. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Brilliant.

    Yea I've been using Enlighten (and SEGI) extensively and could conceivably stay with Enlighten for VR, but equally squeezing more performance out of my lighting system is ideal, especially if the world is largely static. What's kept me away from baking were the slow render times, so PLM has become very attractive.
     
  10. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    I'm blown away by those screenshots of the living room, very impressive.

    In defense of UE, you can achieve ultra high quality results by tweaking the lightmass.ini file, as I'm sure you are aware.
     
  11. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832

    i will check it

    Update:
    As i found on UE sites, My previous settings was in maximum.quality
    Also i found baselightmass.ini and change its parameters to maximum based on this site. Nothing changed on indirect intensity:
     

    Attached Files:

    Last edited: Jun 1, 2017
  12. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    I don't want to derail the thread, but to be sure, Lightmass is fairly sophisticated and uses a different approach to solving the rendering equation. There is an essential (and lengthy) thread on the UE4 forums that discusses the parameters in depth, with input from Koola and Rafael Reis. An additional guide can be found here.
     
  13. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    The only solution are spot lights
     
    Last edited: Jun 2, 2017
    LaneFox and SteveB like this.
  14. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Download Unity EXE

    Final result in lightmap baking time:

    Unity ~10 min with PLM using 1000 sample counts with resolution 14
    Unreal was 4% after 3-4 hours. So i have canceled

    Benchmarks using GTX960 2gb and 4790K cpu

    Unity in editor 4K resolution (top left in Game tab) give me 24 fps with Low SSR and 12 fps in high SSR. Quality was same
    Unity 1080P was 60fps+(fixed by Vsync) with Low SSR and 40 fps with High SSR

    Build size in Unity was 86mb and 261mb Unreal (both was compressed using WinRAR)

    Quality:
    Unity has alot better GI and indirect shadows only with an simple white color as envirountment source

    Unreal had 43 spot lights and very low GI and indirect shadows(most parts of the GI was fake, using spot lights and white planes):
    Untitled.jpg
     
  15. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,673
    Wow, phenomenal work, comparisons and practical imagery.
     
    buttmatrix and LightingBox2 like this.
  16. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    230
    I've been watching your vids on Youtube the last few weeks, the lighting work you are doing is very impressive.
     
    Gametyme and LightingBox2 like this.
  17. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Thanks a guy to give me Unity 4 to test it
    http://imgur.com/a/0wBsn

    I had previously believed that both ,of Unity4 and UE4 lightings are same (even Beast is better than lightmass).So i decided to test a same scene again on unity 4 with old image effects and simple Diffuse reflective cube maps.
    No SSR
    No TAA
    No PBR
    Baked in 10-20 min with maximum resolution in 4096 texture size (I know u4 is dead for nextgen games. But this is just a test for comparison). Used spot light in UE way


    Other comparisons:

    1.jpg
    2.jpg
    photo_2017-06-01_00-06-22.jpg 3.jpg
     
    SteveB likes this.
  18. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    SteveB likes this.
  19. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
  20. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    How to get Offline Render like color grading ?
    First you needs LUT (i have used Amplify Color). Then open LUT on photoshop
    1. Increase brightness
    2. Decrease contrast
    3. Increase a bit blue channel and a bit green channel
    4. Decrease gamma

    Untitled-3.jpg Unity_2017_06_03_08_33_03_89.jpg Unity_2017_06_03_08_33_36_02.jpg Unity_2017_06_03_08_37_02_40.jpg
    Webp.net-gifmaker (10).gif
     
    Last edited: Jun 4, 2017
  21. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Another view of unity PLM+Post processing stack power:
    photo_2017-06-04_05-18-41.jpg
    photo_2017-06-04_05-18-49.jpg
    photo_2017-06-04_05-18-51.jpg
    photo_2017-06-04_05-18-53.jpg
     
  22. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    I start working on unity nature lighting with maximum quality and performance
    I didn't had any experiences on this type of lighting because i already think s unity has shadow problem on transparented shaders . But now i found unity SpeedTree shaders very useful

    My first test:
    PLM,Post Processing Stack,My simple rock models, Speed tree free trees from StarndardAssets

    photo_2017-06-04_14-49-55.jpg photo_2017-06-04_14-50-04.jpg photo_2017-06-04_14-50-06.jpg photo_2017-06-04_14-50-08.jpg
    photo_2017-06-04_14-50-12.jpg

     
    Last edited: Jun 4, 2017
    Aniow, HerrDarko, buttmatrix and 2 others like this.
  23. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Baked and fully Realtime mode comparison:

    1. Fully Realtime without bake:
    photo_2017-06-05_04-26-45.jpg photo_2017-06-05_04-26-52.jpg photo_2017-06-05_04-26-55.jpg
    2. Precomputed Realtime GI:

    photo_2017-06-05_04-27-07.jpg photo_2017-06-05_04-27-10.jpg
     
    Aniow, HerrDarko and SteveB like this.
  24. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
  25. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    After fixing Progressive Lightmapper tree baking issue(black areas), now we can use maximum quality and Path Tracer GI without realtime performance cost:


    Untitled.jpg Untitled2.jpg Untitled3.jpg Untitled4.jpg
     
    HerrDarko and SteveB like this.
  26. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Not to ask a perhaps stupid question, but PLM is baked, so what do you mean by "...without realtime performance cost"?
     
  27. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    I had already used AO in image effects. That's very expensive to render
     
  28. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Right but what I'm asking is how PLM is realtime at all?
     
  29. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    PLM is just for baking. What is means realtime from your opinion?
     
  30. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Just to be clear, I know exactly what PLM is. I'm also an industry developer (see my sig). Not to come across as smug, but just so we can get right into the discussion! :D

    Now I meant what YOU thought was realtime? I suspect you mean performant in framerate, to which I would then ask, why wouldn't baked lighting be faster than 'realtime' lighting such as SEGI or SVOGI (Unreal/Cryengine).

    This is perhaps a semantic argument, but I was wondering why you used the term realtime when discussing a baking solution.
     
  31. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    I'm didn't want to insult. Maybe I wrote wrong. But I mean that i already used fully realtime for nature lighting (without GI) and now i have baked current scene. In baked mode performance is better than fully realtime. Because we needs AO using post effects in realtime mode
    Also i already had worked on Interior renders and comparison with CG Renders. SO i have used Realtime word for every unity render :)
    GI is baked, render is realtime
     
    Last edited: Jun 6, 2017
  32. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Oh no you didn't insult me at all! I just wanted you to be free to be technical and not worry if I understood you or not.

    So how I looked at it is yes, it would go without saying that the 'rendering' was realtime since we're using a realtime game engine. So to answer your question, what realtime ' means to me is that a particular element OF the rendering is 'realtime'.

    I would say for example that SEGI is 'realtime' GI, or that a procedural dungeon generator was 'realtime', but I'd never say that Unity or Unreal is 'realtime' since again, that goes without saying.

    Conversely though I would say that a particular scene/level is a low/high framerate.

    So yea just semantics. Never mind keep doing the great work you're doing and ignore me! Haha...
     
    LightingBox2 likes this.
  33. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    PLM awesome nature lightmapping in 20min:


    photo_2017-06-06_16-35-04.jpg photo_2017-06-06_16-35-13.jpg photo_2017-06-06_16-35-15.jpg photo_2017-06-06_16-35-17.jpg photo_2017-06-06_16-35-23.jpg

    Double sided standard shader
    2 speed tree free models
    3 rock models
    1 house model
    Post Processing Stack
     
    SteveB and mh114 like this.
  34. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Mobile test (960x506 res) with high poly models (6000-7000 each tree)
    Amplify Color for color grading
    Bloom
    100$ phone with Mali T720 mp2 hjfg.jpg photo_2017-06-07_00-16-42.jpg photo_2017-06-07_00-16-50.jpg screenshot.jpg
     
  35. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    How many of these tests you're doing are you adding to your Realistic Lighting Kit?
     
  36. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Nothing. The correct name is Interior Lighting Kit. And it's already has been completed.
    Maybe I'll make a new outdoor lighting kit with rocks and props models. For example 1 desert sample and another jungle with rainy weather.
    I already had tested rock sculpting and find it very enjoyable. Texturing will be done in Substance painter
     
    Gametyme and SteveB like this.
  37. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,448
    Okay cool, as outdoor would definitely be useful to break from the 'Unity look' that plagues nature scenes generally.
     
  38. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Long bake time for both Enlighten Precomputed GI and PLM baked GI forced me to use again full realtime solution similar to UE way:

    photo_2017-06-07_10-56-05.jpg photo_2017-06-07_10-56-15.jpg photo_2017-06-07_10-56-20.jpg photo_2017-06-07_10-56-24.jpg photo_2017-06-07_10-56-26.jpg
     
    Gametyme and SteveB like this.
  39. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Now i want to compare the solutions:
    1. Fully realtime (screenshots on post 88)
    + no bake time. easy specular highlights.easy edit scene.Used in UE demos
    - no GI. no Indirect shadows.

    2. Fully baked(screenshots on post 83)
    + Best performance and GI and Indirect Shadow quality
    - Hug amount of RAM needed (+64gb) for large scenes. Long bake time

    3. Precomputed Realtime GI (No screenshots)
    + Used in frostbite games, so its tested before in AAA games. Day night cycle with GI and Indirect shadows
    - Long bake time

    4. Combining different solutions.
    How it works?
    In this mode we can bake large and important objects like building s and terrain. then use Light probes for other small and high density objects. Both baked and realtime GI can be used in this option.

    In my current test, i have baked all objects with PLM except grass. Then used lightprobes to light grass with GI:
    1.jpg 2.jpg 3.jpg

    More tests will be available soon(Precomputed Realtime GI)
     
    AL_W, olkeencole and buttmatrix like this.
  40. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Latest test
    House and terrain was static:
    Bake time: less than 1 minutes on very low (alot more on high res)
    Quality is same as baked all scene models (takes few days to bake on this mode)
    Realtime GI.jpg

    So best option was this:
    Indirect Resolution : 2
    Very low settings
    House and terrain is set to static
    Bake time : few seconds (less than 1 min)
    Use Light Probes for Trees and grass and ...


     
    Gametyme likes this.
  41. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Finally i found the best setup for :
    Lightmapping (takes few seconds)
    Post Effects (Frostbite and AC Unity style)
    Lighting Effects and shaders (Optimized particle fade shader)

    I will share my experiences for free in an package file with my custom editor scripts to setup quickly with one click lighting setup based on my experience. My goal was Frostbite because unity is very simlar to frostbite lighting model and effects.

    This scene is made in few minutes !!! with pre made effects (Post effect profile). I love this post effect setup too much because is more realistic compare to my previous works (works fine on all day cycles . night&day )

    http://imgur.com/a/EoIXU

    You just need beautiful models and enjoy from good looking lighting without bake time!!!








    Upcoming tool features:
    * Different directional light prefabs with different light colors (Morning,Evening,and ...)
    * Different particle system volumetric fogs (BF Style) with fade option when you are too close
    * Editor window to setup quality lightmapping settings between realtime and baked GI
    * Lighting help (quick start documentation) based on my whole experiences
    * Some lighting related models (Rocks,houses,decals )
     
    Last edited: Jun 8, 2017
    ftejada, scvnathan and mgear like this.
  42. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    You are doing so much for future generations on this thread, really great stuff
     
    LightingBox2 likes this.
  43. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    New simple lighting window with only necessary options and cleaner view:
    Untitled.jpg

    Features:
    * Automatically find sun light
    * Automatically set all lights to mixed, baked or realtime
    * Baking shortcuts
     
    Adam-Bailey and buttmatrix like this.
  44. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    what is this exactly, did you make this, or is this from the newer versions of the beta?
     
  45. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    No it's not from unity. Its my own work to make easier lighting setup...The default lighting window is busy
    my lighting window is more similar to Unity 4 lighting settings
     
    buttmatrix likes this.
  46. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    1.jpg 2.jpg 3.jpg

    Made with unity free and open source assets (paid grass)
     
    Adam-Bailey likes this.
  47. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
  48. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Speed tree prefab with Nature/Speedtree Shader
     
  49. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Added more features:
    * Automatically change all light settings with 1 click
    * Optimized light settings for each light type
    * Automatically activate and deactivate volumetric lighting for all lights on the scene
    * useful buttons(Create terrain, cube, lights, open lighting window and ...)
    * Automatically setup camera and scene settings to best one
    * Automatically add necessity components


    Upcoming features:
    Lighting profile for different day time (Night, Evening and ...) using scriptable objects


    Untitled.jpg
     
    Last edited: Jun 9, 2017
    SteveB and ftejada like this.
  50. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    well done, when will this be available?
     
unityunity