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

When is Mixed mode lighting going to be fixed?

Discussion in 'Global Illumination' started by djarcas, Jun 10, 2015.

  1. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    245
    I keep seeing that it's a 'high priority' fix from posts months and months ago. Is there any ETA? (or work around or solution)

    The issue : If you have some static objects and some dynamic objects, and your directional light is set to Mixed, the dynamic objects do not cast shadows.
     
  2. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    245
    15 days later, and I'm still waiting any sort of response as to a timescale of when this will be fixed....
     
  3. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Also when will mixed mode and painted on trees on the terrain baking shadows going to be fixed. We want the dual lightmaps the way beast did it but to be working with the enlighten system. There's no way to do VAST landscapes in unity 5 with all real-time shadows, just kills fps. We desperately need the terrain to bake in shadows while using mixed mode which is supposed to mimic the way dual lightmaps worked in beast, so we dictate the realtime shadow distance. Please Unity at ETA on this working or how it will work some of us are still using 4.6 and can't switch over until this works completely.
     
  4. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Waiting too. This is a pretty huge bug for anyone doing mid range games that cant afford 20s of realtime lights.
     
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    So. It is September and I encountered this issue.

    Any ETA on bugfix for this feature?
     
  6. Hjeldnes

    Hjeldnes

    Joined:
    Jul 22, 2012
    Posts:
    116
    For really huge landscapes, could you perhaps try with very simplified separate shadowcasters on the Lod versions of the larger assets? And use layer culling on the camera for all the smaller assets(or lod). Layer culling is really quick to setup though. Then set the shadow range really far back. Depends on the type of scene, but maybe worth a try while waiting for another solution from unity?
     
    Last edited: Sep 4, 2015
  7. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    I'm not sure how's that gonna work.What you propose appears to be completely unrelated to mixed mode shadows issue.

    As far as I can tell, unity draws shadows properly. It doesn't paint BLACK over the scene, but instead doesn't add lighting in the shaded region. So there's no shadowcaster without a light source.

    The issue here is that in mixed mode dynamic and baked lighting doesn't mix as it should. Baked lighting work, but there's no dynamic shadows. So, no matter how pretty your baked scene is, it will look very old school, because there's no shadow under character and it floats mid-air. (That's despite the fact that the scene probably required 48-core CPU, 80 gigabytes of RAM and 15hours to bake it.)

    As far as I can tell, short of replacing ENTIRE lighting pipeline with some other solution, this is completely unfixable. In some pointy-and-clicky top-down action game you could employ technology from the 1990s...2000s and draw a "blob" below the character. But in 3rd person game with any semblance of high quality that won't be acceptable.

    The first mention of this issue originate from March. Is anybody even working on it?
     
    Last edited: Sep 5, 2015
  8. Hjeldnes

    Hjeldnes

    Joined:
    Jul 22, 2012
    Posts:
    116
    Yeah, its a pretty critical problem. And also, mixed light should only work for directional lights. Quite limiting. :O
    The whole situation is quite problematic for mobile and large scenes. The shadow caster only "solution" wouldn't fix the mixed light problem, but it might enable you to get shadows from objects further away. Bake local lights that doesnt affect the character (much), as well as the sky + ambient occlusion.
    There are so many issues with lighting, many serious issues that should not have been there at launch, and for sure not now, so long after.
    It seems they are quite overwhelmed in many ways and since Enlighten is not done by unity, well that probably makes it even more timeconsuming/complicated to fix or add things.
     
  9. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    Sigh. That's bad news to me. Can link to official documentation reference that proves that statement, if you don't mind?

    On the side note it would be great if that tool had some sort of GPU acceleration. I have GPU with CUDA support and the fact that it is doing nothing useful during 9 hour long baking process is kinda ticking me off.
     
  10. Hjeldnes

    Hjeldnes

    Joined:
    Jul 22, 2012
    Posts:
    116
    Nothing in official documentation as far as I know, it was only confirmed by Kasper Engelstoft in this forum post: http://forum.unity3d.com/threads/unity-5-how-to-light-large-scenes.307611/
    I asked about the same thing, mixed lights not working etc.. This was back in march, and they would give us a fix "soon".
    Oh well..

    I think gpu acceleration is on the roadmap(as well as LAN building of lightmaps), but it's not set to a specific release. Great stuff, but we can't know when it will be finished. :/ And I have to admit I would prefer them to fix serious bugs first, like mixed, broken gamma, broken probes and so on..
     
  11. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Regarding mixed mode: yes we have top men on it, it is scheduled to go into Unity 5.3.
     
  12. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi! We have experimented with distributed baking, but not CUDA. Deterministic output is very important and executing on the CPU makes it a lot easier to ensure deterministic output (and we don't have to force people to buy a specific GPU).
     
  13. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Yes, we are focusing on bugfixing: light probes, gamma/linear consistency and mixed mode lighting is getting all our attention before we will resume work on the LAN baking hackweek project.
     
  14. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    IIRC modern GPUs are at least supposed to confirm to IEEE spec regarding floating point processing, might be wrong about it. I believe output should be deterministic.
    When there's no GPU, CUDA falls back to CPU. Aside from CUDA there's also OpenCL.
    In addition to that there's ocelot project distributed under BSD license which is supposed to allow CUDA code to run on ATI hardware. Not sure about project status though.

    In any case aside from mixed baking issue the whole baking framework desperately needs at least dedicated standalone "baker" software or at least some way to distribute the load across several machines, even if there's no CUDA support. That's mostly because baking process is incredibly resource hungry, and can easily allocate 20GB of RAM (saw reports of 80GB of Ram being used) and hit the swap on machine that has less. Hitting the swap usually means that computer will be unusable for anything else for a while.

    Of course, that's unless you can make the baking process less resource hungry through some sort of algorithmic optimization.
     
  15. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    I have some experience with OpenCL from a previous job and even though the hardware we used were compliant, we still got undeterministic output across different driver versions. It wasn't stable enough so we went back to a CPU implementation.

    We do have some algorithmic improvements coming with our upgrade to Enlighten 3.02, which means that precompute and light transport will be faster in Unity 5.3.
     
  16. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Good to know 5.3 is targeted for this. Bummer its been set back so long, but at least its getting sorted.
     
  17. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Really glad to hear this, I guess it is pretty tough to get it working across three render paths?

    By the way, are mixed lights going to be limited to directional lights?
     
  18. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    I'd also like to know if for unity terrains when in directional specular mode if painted on trees will have baked shadows finally. Been waiting on this since unity 5 was in beta.
     
  19. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    Hmm. There's still CUDA+Project ocelot option. In addition to that Unity already claims to support compute shaders. So it looks like you have part of the required framework in place. Might be wrong about it, haven't seen engine source. I'm not entirely sure if it is even necessary to have fully identical output as long as results are close enough to each other without causing too much hassle. I mean, I think some of the rendering techniques used in 3D (photon mapping) are not necessarily deterministic either, the renderer just keeps working till results are good enough.

    My point was that this task is computationally expensive and it would be nice to have an option to speed things up with hardware. I offered OpenCL as alternative known option (haven't had much experience with it).

    Also, would be nice to know ETA for the next releases.
     
  20. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    The worry is 5.3 will take ages before being released, especially on consoles.

    Would be good to have this and other bugfixes rolled back to earlier 5.x as they are fixed.

     
  21. Hjeldnes

    Hjeldnes

    Joined:
    Jul 22, 2012
    Posts:
    116
    5.3 is scheduled for december 8 I belive? And as I understood it, they move things to the next milestone instead of letting the current milestone slide. Lets hope that doesn't happen with the current serious lighting bugs.
     
  22. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    This is unrelated to mixed mode lighting. What you are asking about is this: http://issuetracker.unity3d.com/iss...rees-do-not-cast-shadows-into-baked-lightmaps
    Nobody voted on this so far so we haven't prioritized it as high as some of the higher voted bugs.
     
  23. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    You can see the schedule and dates here http://unity3d.com/unity/roadmap/
     
  24. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    Octane renders on some rather esoteric rigs and distributed, do you know how they solve this issue?
     
  25. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    245
    Unity 5.3 is out. Mixed mode lighting is still broken. Unity 5 has now been out for 10 months.
     
  26. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    Sounds familiar.... We relied heavily on lightprobes (which work great in 4.x, were broken from 5.0 to 5.3, but even the 5.3 fix doesn't bring functionality back up to the 4.x level)

    Yet they keep on throwing in the new features...

    I suspect that a fairly significant number of (Pro-using) developers are stuck in 4.x due to lighting issues... with support for that ending in mere weeks...
     
  27. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    I wonder if any issues I reported were dealt with. Probably not.

    The earliest issue I had has been reported back in april, and I haven't heard anything about it yet.

    The deal-breaking issue was mecamin animation notify glitch (they were firing twice), which caused our project to switch to different engine.
     
  28. CiroContns

    CiroContns

    Unity Legend

    Joined:
    Jan 28, 2008
    Posts:
    99
    I was also hoping for a fix for this specific issue. Since 5.3 doesn't fix that, but introduces new problems in the UI for us, I think we're reverting to 5.1 as before... :(
     
    shkar-noori likes this.
  29. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    You're referring to anim notify glitch, right? Back when 5.2 came out we wanted to see if that one will be fixed in 5.3. So I'm sorta curious about it.
     
  30. CiroContns

    CiroContns

    Unity Legend

    Joined:
    Jan 28, 2008
    Posts:
    99
    Sorry, I don't understand what "anim notify" stands for!
    I'm referring to three UI issues actually: one with the line height of the fonts, one with some weird flickering, and one with wrong scaling of the Canvas (I'm about to post about these).
     
  31. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    Anim Notify (Actually I think they're called Animation Events in unity) means that you can place an "event" into animation clip at specific frame that'll call C# function when triggered. Used for spawning hit effects, particle systems, playing sounds at specific point of animation, etc.

    In our case we had double fireballs, and the issue was hard to fix or bypass.

    We had issues with font sizes too. In 5.2.2 unity suddenly decided that 1 point of font size should equal to one unit. Or one meter. Even if the text is rendered onto 3d canvas. It also ignored canvas relative size settings from canvas scaler completely.
     
  32. CiroContns

    CiroContns

    Unity Legend

    Joined:
    Jan 28, 2008
    Posts:
    99
  33. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
  34. mQe

    mQe

    Joined:
    Jul 22, 2012
    Posts:
    57
    Seriously, when will mixed shadows be fixed... It was promised for 5.3.... Still broken for me :/
    This makes shadows completely useless for most people, since you rarely want only dynamic or only baked!
    I see people switching to UE4 because of this which I would really hate having to do.
     
  35. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi, we finally got it into trunk. It will be in 5.4 beta 1.
     
    shkar-noori, Tinovdk and mQe like this.
  36. mQe

    mQe

    Joined:
    Jul 22, 2012
    Posts:
    57
    Great! Thanks for the reply! :)
     
  37. xDavidLeon

    xDavidLeon

    Joined:
    Jun 9, 2014
    Posts:
    123
    Glad to hear lightmapping will actually be useful after > 1 year...

    Anyway, I'm having trouble understanding why is 'Mixed mode' casting shadows for lightmapped objects. It doesn't matter what type of Lightmap I bake. Pre-Computed Realtime GI is disabled. Both cube and plane are Static.

    Mixed Mode (10 Batches - 4 Shadow Casters)


    Baked Mode (6 Batches - 0 Shadow Casters)
     
  38. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Nice - can you confirm if it works with point lights or not? for us it's fine with directional, as its by large a tool for fixing shorter realtime shadow distance falloff and therefore mostly relevant in larger spaces. Merely curious!
     
  39. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    It's normal: mixed mode means that below a distance it's all real time, after that distance it's all baked.
    Move the camera away and see the shadow caster and batch count drop.


     
  40. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    It seems to work, time to push it to a 4.3 patch, K!
     
  41. xDavidLeon

    xDavidLeon

    Joined:
    Jun 9, 2014
    Posts:
    123
    Didn't know that! Is that documented somewhere?
    Anyway, thanks! :)
     
  42. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    It's in the doc, just not well explained: file:///Applications/Unity/Unity.app/Contents/Documentation/en/Manual/class-Light.html
     
  43. Hjeldnes

    Hjeldnes

    Joined:
    Jul 22, 2012
    Posts:
    116
    @laurentlavigne Are you sure mixed lights are working? I did a test, and it does not work as expected. According to your comments above, then you are describing the old mixed lights/dual lightmaps approach we had in 4.x using Beast right? I don't think that's valid anymore with Enlighten.

    As I have understood this, the realtime shadows should blend with the baked shadows. D
    It seems that cast shadows are not affected by ambient. This is just a single directional, set to mixed. The green objects are dynamic(not static). The dynamic objects also do not get shadowed when in a baked shadow-area.

    @KEngelstoft How should mixed lights to work, according to you unity guys?
    Screenshot 2015-12-27 14.59.33.png
     
    neginfinity likes this.
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Is mixed mode interesting with good results or will it be dropen at some point ?
     
  45. Hjeldnes

    Hjeldnes

    Joined:
    Jul 22, 2012
    Posts:
    116
    Well, the old type of mixed lights (with dual lightmaps) worked rather well, it enabled us to have a short range of realtime shadows, and we could have lightmapped shadows in the distance.

    Shadows have been optimized and are now cheaper than they were in 4.x, but we still need to bake shadows on really large scenes and/or on medium/low end hardware. We can't have large shadow ranges and shadows from everything.

    If I got it right, unity has now planned to change the way mixed light are to be used. Because of Enlighten I guess.
    Mixed lights should be realtime from/on dynamic objects and baked from/on static objects. The realtime shadow should be blended somehow with the baked shadow. In other words, no overlapping shadows when the dynamic object is within a baked shadow area.

    According to @KEngelstoft :"Hi, we finally got it into trunk. It will be in 5.4 beta 1."
    but it does not seem to be working.
    Some hints on how mixed lights should work would be appreciated.
     
    zenGarden likes this.
  46. DamonJager

    DamonJager

    Joined:
    Jul 16, 2015
    Posts:
    56
    Mixed lights aren't casting shadows from dynamic objects. I didn't know that this was a bug. It makes sense now. So much could be done if this woked.
     
  47. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Also the level directionnal ligth in "real time" mode don't blend well with the terrain using a baked lightmap, the light cast too strong shadows and on small camera distances only, this makes the light shadows lot more darker and overriding Enligten baked lightmap.

    With a directionnal light "mixed mode" , within the editor

    Real time game , the trees are lighten and not following the lightmap shadowing


    How do people making games and using Enlighten to succeed ?
     
    Last edited: Jan 3, 2016
  48. Tinovdk

    Tinovdk

    Joined:
    Nov 28, 2013
    Posts:
    83
    Thank you!

    This post deserves more likes. I can imagine Unity devs were as frustrated about this problem as we were.
     
  49. HGD

    HGD

    Joined:
    Apr 4, 2015
    Posts:
    3
    Still broken in 5.4 beta 1 - trying beta 2 now.
     
  50. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Ouch.