Search Unity

Unity's Enlighten - baked lighting a big step backward from Beast.

Discussion in 'Global Illumination' started by Mahoney014, Jul 23, 2015.

  1. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    So after a little experimentation with Enlighten's individual object settings, I am able to get a cleaner result but I still deal with light leaks in some parts of the geometry... here are some examples of what I am dealing with... I could simply fix this by having no holes in ANY mesh...

    Here is shot with some lightmaps baked after playing around with the settings a bit... the only light is coming from the sun outside (I have a scene set in the day time). I also picked a few areas to bake from just to test settings and fix potential light leak issues,

    In the first screenshot, after tweaking some settings I got some satisfactory results, though light leaks and cigarette burns are very visible... I guess to fix this, I have to close the geometry (COMPLETELY) which means no holes whatsoever.

    Screenshot 2016-01-26 23.32.37.png
    cig
    Here is another bake from another angle... hotspots are another issue I have to contend with as well as lightmap scale... this will be a complete level once I get the textures and lightmapping handled... I decided to tackle this first before continuing on with texturing... if you are familiar with light leaking and cigarette burns, you could bevel your geometry and close any holes in your meshes... sounds unoptimal, but I want to try this before moving on... I also lowered my baked resolution to 60 and it still looks great...

    I did encounter some seams in my bakes but since most of the texturing will cover this and especially since my game is a 2.5D fighter, you will never see these issues...

    Screenshot 2016-01-26 23.42.44.png

    Screenshot 2016-01-26 23.44.15.png

    And a "not so beauty shot from the game view..." I haven't added light/reflection probes yet since I want to get this figured out now. With careful thought and logic (I'm doing this on my spare time so I can futz about with settings to my hearts content) you can get clean bakes... but for those with deadlines, Enlighten needs to be a little tighter... especially with baking the content... it should be a set it and forget it kind of system...

    Screenshot 2016-01-26 23.58.30.png
     
  2. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    I get rid of dark spots by creating own lightmap parameter > increased "push off" value to 0.14 .

    Check in, that might solve your dark spotches......
     
    KRGraphics likes this.
  3. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Thank you for sharing about your project.Would love to play it once you publish it.Plz send me link then.

    Are you sure your precomputed were off? also does your lightmaps setting disabled "Auto" ? plus does your light in window were set to "Baked" or "mixed" .Also does your envionrment were marked as static?
    I just tried in unity 5.3.1 this ,baked everything with Baked GI > then try to change ambient intensity.But nothing is changing as it supose to be.Here is video of it ,



    Yes you are correct in Unity 4.6 and below baked lightmaps were looking much better and fantastik.

    Sadly ,Standard shaders are not suppose to be for mobile devices and so does Precomputed GI.Unity guys have mentioned it here and there about it.The legacy shall be marked as "Faster and better" and may be reintroduce Beast lightmapping in Unity 5 again .May be under Window > Legacy .
     
    JamesArndt likes this.
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    And btw, the light in my scene is set to real time
     
  5. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Yes there are serious regression issues with Unity 5, I noticed it too as Hippocoder said, he also said not to use the Standard Shader for mobile, each texture slot used takes 1 draw call. I use custom shaders anyway (I know, Unity is getting to that point where we have to use custom everything).

    As for the Lightmap blotches; you're screwed. Apparently 5.4 is supposed to add a lot more, it's a pretty big milestone unlike the last ones. It will be my last trial of the 5 series and if it fails I will stick with Unity 4 and wait for Unity 6. Did you know that the docs in Unity 5 have several not available in C# regressions, they are available in 4! Haha!

    I remember seeing a free vertex lighting tool that allows beast lighting to be baked to vertex colors! If we can get a solution that will multiply vertices only in areas where resolution is really low, then we have FREE baked lighting which doesn't take up any space. Here is a sample:

    Video1:

    Video2:


    I currently have nice looking visuals in Unity 4 and Unity 5 (GI is disabled), but yes, the shadows need a big improvement in 4. Ultimately I will probably go with an alternative anyway, can't afford a draw call per shadow system.
     
  6. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    If I could find a way to get around this crap, I may end up baking my Lightmaps in Modo but I would have to figure out how to get the lightmaps into Unity... and with some playing around, I will get around the splotches.

    It is pretty serious to ignore that for so long... and especially getting results that are inconsistent after each bake...
     
    Last edited: Jan 27, 2016
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    Actually ambient light (set from Render Settings) in beast did affect everything everywhere. So I am not sure what you mean here.

    In Unity 5, ambient light is a light probe for objects to fall back when there are no valid light probes on the scene.
     
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    It's been so long since I've used Beast... so I may have missed something. I'll do another test to see what I missed.
     
  9. Gonzilla2013

    Gonzilla2013

    Joined:
    Jan 23, 2014
    Posts:
    3
    I´m tired this guys of Unity technologies...Everybody is tellling them: Enlighten sucks and what do they do? Only ask for report bugs and excuses about use of this lighting. Understand this: Enlighten sucks, we miss Beast. Sometimes new isn´t equal to better.
     
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    I am pretty sure they know.
     
    spryx and JamesArndt like this.
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    So in my tests, I crank up the bounce intensity and I get a lot of light leaks and continuous inconsistent lightmap bakes... I wonder if the UV atlas is getting switched around or something because I look in the light maps and I see SO MUCH WASTED space...I was about to create a custom lightmap with everything in in to see what would happen... and even at high resolution, I get a lot of inconsistent details...

    Honestly, I wish Enlighten could make use of photon mapping like beast did... at least that was clean and predictable...
     
    AaronC likes this.
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    Beast was final gather based (I also think it had pathtracing, but it wasn't used by default).

    There's also Final Gather support in Enlighten, but it's pretty basic. They added a denoising filter in 5.4, but it's still pretty basic.
     
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Yes, Beast had Path Tracing and Final Gather... it also had Monte Carlo GI which was as brute force as it gets (and unlocked via XML). And after you waited, it looked REAL GOOD. Enlighten needs more options to control it's details and stop wasting atlas space. Put that texture packing back in. Thank God my levels are small and the light maps are clean, otherwise my lightmaps would have to be baked externally.
     
  14. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    And if you want clean and fully packed lightmaps? You will have to pack it on your own in a 3d app and carefully unwrap it all. A quick atlas in your app and you're done
     
  15. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    The default method that you used without adding custom settings with the xml file was final gather, the same method that is available in Enlighten.

    Enlighten's implementation is pretty basic though and that is the problem.

    About the packing: as far as baked lightmaps are concerned, it's as bad/good as Unity 4's.

    I wish they switch the packing algorithm to tight packing though, like they had in Unity 3.
     
    KRGraphics likes this.
  16. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I love the packing in U3! Now I have to do my own packing :(
     
  17. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    I've found I get better packing if I manually go into the object resolution settings in the lighting window and adjust the resolution of individual objects to better fill space. Pain the butt, but it helps.
     
  18. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467

    I did all of that too. Scale in lightmap... but in some areas, it's still wasteful. I'm waiting for Final Gather to finish... I have it cranked to 25,000 rays. I'm also dealing with rays missing at random bakes, resulting in black spots.
     
    Last edited: Jan 28, 2016
    JamesArndt likes this.
  19. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Yeah another way to kind of zero in on better UV layout is to do your lightmap UVs in the 3d package before they get to Unity. They will still get broken up by Unity, but at least you know what you are looking at when tweaking scale and proportion.
     
    KRGraphics likes this.
  20. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    V
    Exactly. And for my current project, that is what I did... careful UV layout and packing... and not only that... the texel density is more or less equal. Lightmaps don't need extreme detail so the texture size can be small...
     
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    So after playing with Enlighten for the last few days, I've managed to get clean bakes with careful planning and making sure my textures are done before baking. And pure white surfaces will blow out.

    Also, if you don't have smoothing groups on hard edged meshes, you'll get bake errors
    q0
     
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Screenshot-2016-01-30-17.59.jpg

    After taking some time to today to bake my scene, this is the cleanest I've gotten it... once I get the entire level textured, it is going to be so much fun getting everything cleanly baked :)
     
  23. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    I found a tool called Fast Shadows in the asset store, it basically creates fake shadows but can handle hundreds of them all under 1 draw call. It works great for a game like mine where most of the shadows are being used by the same thing which is mostly fruits and collectibles. It's not real shadows but it works as if they are....it even comes with a shadows generator and atlas map! It's pretty crazy.
     
  24. pez

    pez

    Joined:
    Jul 6, 2013
    Posts:
    52
    Hi, I too am on the anti-enlighten bandwagon.
    After reading through this (& the many other threads related to how poor enlighten is) - I've come to the conclusion that at no point soon is it going to be in a state that I can work with. Unity seems to just be on the defensive over it's flaws & ignoring questions that they clearly can't or don't want to answer (like the ridiculously long bake times etc.)

    I already had the pleasure of trying to port a project from 4.6 to 5 - & then trying to figure out how on earth to get the lightmaps to look like they did previously (in the end I had to literally paint lightmaps onto textures in photoshop & use extra lights/realtime shadows as a workaround... avoiding using enlighten entirely)

    Now that I'm at the lightmapping stage on a new project I think I'm just going to have to bite the bullet & do it all with a different program. Does anyone know of any good workflows or tutorial links to get me started? & how to reintegrate all of it in Unity! Cheers,
     
  25. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    What exactly was your problem with it?
     
  26. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    ......I think his problem is that the light-mapping is extremely poor compared to what it was with Beast. Thought that seemed pretty clear :)
     
    mh114 and KRGraphics like this.
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Extremely clear :) and in my current level design, I can't even use Mixed mode because it is not working correctly and I am forced to keep everything set to real time which is not logical. Also light probed objects don't match the baked ones, you can easily see which on is light probed, just by the colour differences. And I hope 5.4 fixes Enlighten and the mixed mode issues... I will say now, Beast has this process easily and painless
     
  28. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    That's the problem I have now - basically my only choice seems to be to use ALL realtime lights. As a lightmapper, Enlighten seems to be unusable. I would love for someone to show me that that's not the case, but the topic always seems to just be greeted with complete silence.
     
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Seeing Enlighten used in several games, not least Dice's stuff, tells me that Enlighten is potentially awesome. What do they do, that Unity doesn't? And why?
     
  30. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    What I'd like to see is a really straightforward tutorial (preferably from Unity themselves) along the lines of:

    "How to make Enlighten bake awesome looking lightmaps like Beast used to"

    Surely it can do it right? So it has to be a matter of process and settings, but... what are they?

    I've tried SO many combinations and read up on everything I could find, and I never get results that differ too much from what's shown in my other thread here:

    http://forum.unity3d.com/threads/why-does-my-lighting-look-so-s.389284/

    I did eventually figure out that turning OFF "Precomputed Realtime GI" improves the overall look massively when using realtime lights (at least on indoor scenes like mine), but I've never come up with anything for fully lightmapped scenes that is even remotely useable.
     
  31. pez

    pez

    Joined:
    Jul 6, 2013
    Posts:
    52

    Yes I agree a tutorial like that would be useful.
    I couldn't even get a decent looking bake from just using a Unity cube, flat plane & directional light!
    Love the way the bake ignores your settings on the shadow intensity & just pushes it to the maximum. Who on earth would want baked shadows to match the realtime ones!.. Sigh.

    My only other option at the moment is to just go realtime lights for everything as well. That's really not sustainable for us though, because of the graphical limitations with VR.
    & limitations aside, I actually want a lightmapping solution to have AO at the very least! Someone needs to make a Beast duplicate for Unity 5 & put it on the asset store!
     
    KRGraphics likes this.
  32. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Here is a bake I did with just baked GI and no precomputed GI... it looks amazing as hell... don't mind the bright parts, still texturing this bad boy. But the character models are overly bright... and in simpler scenes, my character models don't cast shadows in Mixed Mode either so I am forced to keep everything in realtime, which is foolhardy on performance. I didn't have this issue with Beast Screenshot 2016-04-26 08.46.31.png
     
  33. Robert-HGG

    Robert-HGG

    Joined:
    May 27, 2015
    Posts:
    10
    tryptic and KRGraphics like this.
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Time to wake up and get cracking on this. We should have already had enlighten current.
     
  35. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    Baked lights shouldn't even have a Shadow Strength setting. Are you using Baked lights? Mixed doesn't work properly as far as I know.

    Enlighten has had AO for the entire time.

    Your lighting settings look insane and the characers don't look overly bright compared to the light... Try the default settings and work from there.
     
    Last edited: Apr 27, 2016
  36. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    I think Unity is undergoing two massive changes: the source code is being cleaned up and the corporation is restructuring massively from a bunch of friends making a kickass engine to being a new Autodesk.
    Maybe in a few month to a year this will be over and they'll start to catch up, if that happens - hang on to your seats!
     
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    That room just have two bounces of light... which would look very close to reality. I keep indirectly intensity at 1 and just up the bounce boost until it looks good to my eyes... I usually keep it at 3 until I have my other surfaces textured. when I just have baked GI, it looks marvelous... I usually use both precomputed and Baked because I will have characters in the levels fighting
     
  38. tryptic

    tryptic

    Joined:
    Nov 13, 2012
    Posts:
    55
  39. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    might want to check on how Dice doing their lighting on the latest mirror edge, there's some good info there since they also using enlighten. It a good read for anyone, including for unity lighting team since they have a nice trick on lightmap blending for day of light system and baked specular/reflection occlusion from enlighten which is still missing in unity.
     
  40. Robert-HGG

    Robert-HGG

    Joined:
    May 27, 2015
    Posts:
    10
    I think there is some confusion going on right now.
    Enlighten may be only the Real Time Global Illumination system. Since Unreal engine is using Lightmass for baking
    http://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/index.html
    so that would mean that Unity, after losing Beast, has their own lighting baking system, and that would explain its poor quality(visible seams, leaking light etc) and long render times.

    Can someone clarify this?
     
    tryptic likes this.
  41. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    I'm confused about this too, to be honest. Is Enlighten a "lightmapper" in the same sense that Beast was? Or is its functionality... "different"... due to its nature as a GI lighting solution?
     
  42. Robert-HGG

    Robert-HGG

    Joined:
    May 27, 2015
    Posts:
    10
    It seems Enlighten is only calculating the real time global illumination and its not baking the lightmaps.

    Unity must be using something else, probably their own code, for baking lightmaps.


    That would be a bad news to be honest.
     
  43. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    That is not very enlightening :(
     
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Screenshot 2016-04-28 06.43.44.png Here is a new issue I'm running into: inconsistent irradiance. I'm lighting a small dojo and I noticed that even when polygons are facing the same direction on my mesh, parts of it are PITCH BLACK lIke in the screenshot. This is a problem and being forced to enable Generate Lightmap UVs ( when I have my own UVs for lightmaps) is not a fix.

    The render I am sharing is before I regenerated lightmaps.

    EDIT: So after rebaking my lighting, the results are still the same. It can't be overlapping UVs because their are auto generated. Something else is going on
     
    Last edited: Apr 28, 2016
  45. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,536
    My biggest complaint is that it takes ages to bake and see what it looks like. I'm finding it really difficult to do practical trial and error because it takes hours to bake something.

    I guess what baffles me is that I can get good results realtime that run okay, so why can't that just be snapshotted, saved as a lightmap or whatever and used forevermore? What actually takes so long to do in baking that realtime can somehow do pretty much instantaneously?
     
  46. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    It seems like it's more a problem with your models than enlighten.
     
  47. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Honestly i never get any render time problem with enlighten with the latest unity version 5.3 and 5.4b. The only problem with enlighten are the bad lightprobe, and no specular occlusion generated from enlighten come on unity.



    and mixed mode
     
    Last edited: Apr 29, 2016
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I have been checking my model carefully and everything is in place... the UVs are laid out 0-1, and I have my own UVs for lightmaps. And it is a model that is separate pieces so I can easily correct it. I get the same thing when I allow Unity to Auto Generate UVs in the import settings. I have been checking the HELL out of this model. I also have a skybox OUTSIDE and most of the meshes are picking up the ambient lighting except the parts I have explained

    So unless I have to model my environments in a certain way, then this is restrictive as hell... maybe updating to the latest version of Unity 5.3 should fix my issue. I am looking at the irradiance map and those black spots should be lit. I have a directional light that is supposed to be the sun...
     
    Last edited: Apr 29, 2016
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Here is another screenshot:

    Screenshot 2016-04-29 10.14.42.png
    Screenshot 2016-04-29 10.13.39.png

    The parts that are facing the same direction should not be black whatsoever. I guess setting the Max Angle to 180 seems to fix this problem for the Precomputerd GI, so I am going to try this for the baked settings... my guess is, when the shells are bigger, any discontinuities will cause the lightmap to look wrong. But I wish the packing system was a bit smarter... and the UVs you see on the baked intensity are my UVs that I made in Modo

    Screenshot 2016-04-29 10.34.56.png
     
    Last edited: Apr 29, 2016
  50. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Can anyone tell me the function of the blocker parameter in Enlighten? It is suppose to stop things like photons leaking through