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

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:
    235
    Broken in 5.4.0b3. We *do* now get shadows for realtime objects.

    So yay there.

    But they 'stack' with baked shadows.

    So, yeah, can we get the old dual-lightmaps back? I still don't really see how I can have lightmaps at a distance, and realtime up close, even with this 'mixed' mode.
     
    a_tarerra likes this.
  2. Alchemy_Fire

    Alchemy_Fire

    Joined:
    Aug 27, 2013
    Posts:
    14
    My experiments with 5.4.0b5 have been pretty unsuccessful. It kind of works for a single directional light but the realtime and baked shadows don't match (plus what djarcas mentioned about additive shadows). Also, for me the issue isn't really with a single directional light - its with point & spot lights. With forward rendering a single realtime directional light in a daytime scene is performant (at least on desktop). Its the overlapping point lights lighting a terrain at night that are the problem - have too high a terrain pixel error and you fall foul of the pixel light count limit (lights 'pop'), have a low pixel error and there are too many draw calls generated by the terrain / shadowcaster combinations. Deferred is fine for relatively recent cards but I'm struggling to implement decent nighttime lighting + shadows for lower end cards and laptops. Mixed_Directional.png
     
  3. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    Well, that's not really a Unity problem, that's just the reality of real time rendering. Pixel lights are inherently expensive to render, and the whole reason deferred rendering exists is so that you can have as many pixel lights as you want without a massive performance impact, at the trade off of having a higher base cost. You can't have many real time point and spot lights on lower end hardware because of this - that's just the way it is.
     
  4. Hjeldnes

    Hjeldnes

    Joined:
    Jul 22, 2012
    Posts:
    116
    Well, I think it is a Unity problem. They have focused too much on high-end specs only, without a proper alternative for lower/mid range hardware (and for games with larger complex scenes). Mixed lights were supposed to let us combine baked lighting with realtime lighting, and the fact that it still does not work a year after release is a tragedy. An even worse tragedy is the silence from unity devs. It would be really, really nice to know status other than cryptic beta release notes.
     
  5. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    235
    *hits refresh a lot*

    Come on, surely someone at the Unity team can go poke their manager, who can poke THEIR manager, who can go poke Aurora, who can then go poke whoever is in charge to come give us a useful response as to what we'll be getting, and if it will allow us to mix baked lighting at a distance, which is cheap and crap, and then real time lighting up close, which is expensive and awesome, and when we'll get it, and, pretty please, why the hell we've had an entire YEAR without support for this!

    I struggle to see how else VR stuff is ever going to hit a high framerate *and* a high level of quality.

    Please help us to write pretty games?
     
    radimoto likes this.
  6. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I think mixed mode is problematic, Enlighten can't support mixed lightening.
    The only solution is Unity to research some real time Gi solution like CryEngine Svogi and let Enlighten working only in baked mode.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    No. Precompute is the "good" part of enlighten. Baked mode is so subpar, they might as well take it out.
     
  8. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Fast precompute ? In CryEngine, you are in real time GI in one second.
    I have doubts about Enlighten , the baking time is really too long, i would just like real time GI like CryEngine , as fast (it runs good on old hardware) for small and big projects if mixed light in Unity is too complicated to get it.
     
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    I didn't say it was fast. I said it was the "good" part of a pretty bad technology.

    Also. To give it some credit, at runtime, the precomputed GI is much lighter than the realtime GI in CryEngine, so.
     
  10. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I run CryEngine or LumberYard on old hardware with real time GI on, so it is already fast GI and engine.
    What is precomputed in CryEngine ?
     
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    Are we not communicating properly?

    Unity Precompute, should be faster than CryEngine GI, at runtime.

    (but unity needs baking and is more limited and possibly looks worse)
     
  12. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I agree , still real time Gi in CryEngine (or new Lumberyard) is pretty phenomenal (or because it is fast and combined with a fast engine).
    If you bake a small terrain with stuff on it it will take ages, or a simple plane with objects on top, this is why i don't like a lot Enlighten for PC games, while it is valid to make fast mobile games looking good.
    I would really like to have news on mixed mode as it is needed if you want your characters to have the same lightening as the baked one. So you would have a fast game with baked lights with dynamic lightening mixed in.
    Perhaps it is not possible with Enlighten.
     
    Last edited: Feb 17, 2016
  13. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,021
    (and I do not disagree)
     
  14. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    I think it is a direction leading to a dead end.

    UNity needs proper lightmapping solution for lower-end hardware/mobile and currently it doesn't have any.

    Unreal 4 has "Stationary" lights which are pretty much the same thing thing as what mixed-mode lights are supposed to be. Basically at any point scene you can have up to 4 stationary lights overlapping (directional stationary affects entire scene), and dynamic shadows from those lights will properly blend with baked shadows. This is achieved by storing each shadow map in 1 of the channels of stationary lightmap texture.

    In short, If enlighten can't support it, it should be made to support it. Given that one of the lightmapping modes is "non-directional", and that there's "non-realtime" baked gi, I don't see why this wouldn't be possible.
     
  15. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    39
    Sometimes I feel like Unity have been sold snake oil when they decided to implement Enlighten, and I don't know whether to feel sorry for the developers or users. Each update and forum post reads like they're trying to make the best of a bad situation. I could be wrong, but it's the impression I get.

    5.4 beta has some nice improvements (Denoising Final Gather is amazing), but they're still a long way off from reaching Beast's fidelity. 5.4 is a month away so there's still time to surprise us with an update that fixes mixed lighting once and for all, but I'm not going to expect it.
     
    mh114, bluescrn, j-baeza and 3 others like this.
  16. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    Indeed, Unreal's lightmapping is amazing. I recently started using it for a new project that requires a higher level of graphical fidelity, and I'm just blown away by how easy it is to get amazing looking lighting, without any effort required from my part. Especially the "light portal" feature of the upcoming 4.11 release makes interior lighting for architectural visualizations (and other use cases too, of course) an absolute pleasure.

    It's also important to note that baked lightmapping is not just something for lower end hardware or mobile - it is still very much relevant to high level hardware too, because you can afford to do many more bounces and shoot more photons than you would be able to in real time. This makes it all the more painful that Unity 5 has been struggling with this for so long, even though it has improved with leaps and bounds in other aspects.
     
    AcidArrow likes this.
  17. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    235
    ::tumbleweed::

    I'm still back to using a pair of lights, one culled to the static world and one culled to the dynamic only. This really is ridiculous :|
     
  18. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    235
    So 5.4 is out today -
    • In deferred rendering, lightmapped objects affected by mixed-mode lights will fallback to forward rendering.
    That's the only mention of mixed-mode lighting - is it fixed then? Please, please, PLEASE, give us information rather than doing dark. No pun intended.
     
  19. greenmonster

    greenmonster

    Joined:
    Jan 18, 2013
    Posts:
    26
    From https://unity3d.com/learn/tutorials/modules/beginner/graphics/lighting-and-rendering:

    Selecting the ‘Mixed’ baking mode, GameObjects marked as static will still include this light in their Baked GI lightmaps. However, unlike lights marked as ‘Baked’, Mixed lights will still contribute realtime, direct light to non-static GameObjects within your scene. This can be useful in cases where you are using lightmaps in your static environment, but you still want a character to use these same lights to cast realtime shadows onto lightmapped geometry.
    This is really still not working even though Unity's lighting and rendering page specifically says the above?
     
  20. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I don't know , but we really need it.
     
  21. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    I have give up on this. For the moment I just use one directional light and realtime shadows on objects with GA turned off completly. Most mobiles can handle that, but it cant really do many good effects...
     
  22. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    Thinking about it, this description doesn't make any sense.
    "Adding light to dynamic objects" will not let dynamic object cast shadows onto static objects.
     
  23. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Like Unreal 4, the lights are baked static, but when a character passes near, the lights are activated to become dynamic and cast a real light on the dynamic character.
    This is what i understood.
     
  24. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    I'm not sure if UE4 actually works this way (didn't dig through the part of the code). There's special "stationary" light type, which can be baked into shadowmap that can blend with dynamic shadows. Those lights are not baked static. There's 4 channel lightmap map (1 channel per stationary light) so only 4 stationary lights can overlap at any point.

    The wording doesn't make sense, because it literally says that "mixed mode light can affect dynamic objects". Doing that won't create shadow on static objects, which would make the feature pointless. To cast shadow onto static object from dynamic object, you need a way to blend shadowmap with baked shadow, so a shadow for "mixed" or "stationary" light should be stored in different fashion, separate from standard baked shadow.

    Then it for some reason says that you can cast shadows. o_O

    That's why it doesn't make sense to me.
     
    Last edited: Mar 13, 2016
    zenGarden likes this.
  25. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    So.......
    Im at the stage now where we need know about the status/future of mixed mode lighting in Unity?
    Is mixed mode lighting with SHADOWS going to be fully supported by Unity/Enlighten? IF so does this include point lights and spot lights?
    Becuase right now most people dont even know if it SUPPOSED to be working, LOL
    Currently it only seems to be somewhat usefull with directional lights.

    We need to move forward here. It's long past due. There's nothing on the roadmap regarding mixed mode lighting anymore. Is it a dead end road? If its not going to be implemented or supported, then we have to look at other solutions (shadow blobs, other lights, and other "hacks" to handle realtime shadows projected on baked meshes). The progress is put on hold for now.

    Does anyone know the answer to theese questions?
    Thanks you
     
    Last edited: Mar 14, 2016
  26. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    Tested it. Red box is dynamic object, the environment is static. One mixed directional light. Red box is supposed to cast shadows onto objects behind it. Ambient is defined as color, and is not read from sky.
    Unity version 5.3.3f1

    Deferred rendering, mixed directional light:
    deferred-mixed.jpg
    Deferred rendering, baked directional light:
    deferred-baked.jpg
    Forward rendering, mixed directional light:
    forward-mixed.jpg
    Deferred rending, realtime directional light (umm, what? looks like lightmapping artifact to me):
    deferred-realtime.jpg

    //unity filled the disk with GiCache data, ran out of disk space and crashed
    GI and baking disabled, full realtime lighting:
    no-gi.jpg

    Conclusion:
    Broken.
    In forward rendering path environment does not cast shadows onto dynamic objects. (Seriously?)
    In either rendering path dynamic objects do not cast shadows onto environment, but mixed mode lights cast shadows from STATIC environment onto DYNAMIC objects.
    They don't cast shadows from DYNAMIC objects onto STATIC environment. Which kinda defeats the point.

    I think that someone at unity seriously doesn't understand how lighting is supposed to work, and how dynamic shadows are supposed to blend with static ones.

    Also, you'll have hard time faking proper shadows with other lights, because in this kind of PBR environment shadow is absence of light, not a "dark shape", so to draw proper shadow, you need to re-blend lighting with the environment, while "not re-blending" shadowed pixels.
     
    ArachnidAnimal likes this.
  27. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    And here's what fully static lighting looks like (all objects are static):

    full-static.jpg
     
  28. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I don't understand why it is so difficult ? Once the lightmap is baked the most work is done, than dynamic objects should use the main directionnal light and other near lights receive lightening and cats shadows.

    Theer is some interesting coming feature
    I wish we could use it them to have some new lightening system approximation GI the game level without needing days of long bakings. This would be usefull for big open worlds and long distance lighteninig.
    , this could feet some games types, take a look from p12 :
    https://bartwronski.files.wordpress.com/2014/05/assassin_s-creed-4-digital-dragons-2014-no_notes.pdf
     
  29. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    Because that's not how lighting works.

    To get proper shadows you need to overlay light layer by layer from each individual lights on top of each other, adding them together. For each pixel for every "layer" of light you multiply lighting you received from light source with "shadow" factor (among other factors, like falloff, etc). 0.0f if object is in shadow, 1.0f if it is fully lit.

    Once lightmap is built, individual lights are gone and all factors are combined into one flat texture. So you can no longer extract individual lighting "layer", blend it with updated shadow factor (affected by shadowmap) and add it to the scene again. There's no data to be multiplied by "shadowmap" factor.

    That is why Stationary lights in UE4 are a special case. They store their lightmap data differently, in easily extractable format (one channel of RGBA texture per light).

    Now why the hell doesn't unity do the same thing as unreal engine, is completely different question, and honestly, I don't know any good answer to it. I can only guess that someone who's responsible for the lightmap building doesn't understand value of lightmaps and just always uses either full realtime lights or fully static environment.
     
    landon912 likes this.
  30. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    Im rolled back to Unity 5.2.3, so I'm not sure if this post is still relevant. Also Im only using baked GI, no realtime GI.
    mixed.jpg

    I dont know if anything changed between 5.2.3 to 5.4 with respect to mixed mode, but if Unity/Enlighten could find a way to "merge" the results shown in the picture, then I would consider Mixed mode to be successful for a directional light only when using only Baked GI (Unity 5.2.3).
    j
     
  31. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    I am a little worried with the distinct lack of replies from the developers regarding this.

    If it is no longer supported, I wish they would just say that and drop the option from the editor.

    If they are going to be fixed, I would really like to know why it is taking such a long time to be fixed while at the same time so many new features are being added to Unity.

    If Enlighten just cant support this, then that is cool too.

    I just cant decided if I should stick with my one realtime directional light set up like I have now, wait for mixed lights to be fixed or go fully baked - which I want to avoid based on other peoples experiences documented on the forums.

    By fixed I mean;

    Mixed lights are baked for static objects. Mixed lights casts shadows from dynamic objects onto static objects and static objects cast shadows onto dynamic objects. That is how it worked before right?
     
    landon912, neginfinity and a_tarerra like this.
  32. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    I bet that your scene didn't finish baking. Once baking is done , dynamic objects no longer cast shadows onto static ones, baked lighting or not, deffered or not. Second scene definitely looks like the baking hasn't finished.

    I also I sorta was excited to see shadow from dynamic object being cast onto static object (during last test I posted) and then I noticed that baking is still in progress. Once baking was over, the shadow from dynamic object disappeared.
     
  33. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    The lightbaking completed (baked GI). I then switched the light to "Mixed" and to directional after the baking completed. The light was set to baked and spot light prior to the bake.. Im not sure if this has anything to do with it.

    lb.jpg

    The realtime shadows look very strange, but at least they are showing up on the baked meshes for me (only in forward mode). Again, this is only working for a directional light, not spot or point light.
    This is another question to answer: is it going to work for all types of lights?
    I dont want to use directional lights because they are very bizzare for indor scenes.

    j
     
    Last edited: Mar 15, 2016
  34. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    I can only say that it didn't work for me yesterday, which is visible on screenshots I posted. I also haven't tested spot light, only directional one.
     
  35. thehosse

    thehosse

    Joined:
    Nov 29, 2013
    Posts:
    35
    It's a shame as the Realtime lighting quality is really good, but most platforms simply can't run at good framerate with fully realtime lighting, mixed mode is essential.. We desperately need a way to LOD the lighting Unity.!

    Can't we just have Beast back and forget all this Enlighten nonsense happened?

    BRING BACK BEAST.......
    BRING BACK BEAST.......
    BRING BACK BEAST.......
    BRING BACK BEAST.......
    BRING BACK BEAST.......
     
  36. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    If mixed mode appears this will be better than Beast lightmapping.
    And we should get a faster lightmapper, take a look at 36:30
    www.youtube.com/watch?v=eN3PsU_iA80
     
    shkar-noori likes this.
  37. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    Plz fix this, or just reply
     
  38. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    I do not think this will be any faster. It'll allow faster preview and only that.
    Murphy law says it also won't fix mixed lights.

    Also I'd really like to know when this thing is gonna be released.
     
  39. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Pretty sure Unity has heard this thread :)

    Personally, I don't want mixed mode lighting. I would prefer realtime lighting (for mobile as well) but using shadow buffers so that the buffers only update when they need to. This is surprisingly quick, and you don't even have to bake. Shadow buffers only update when they need to instead of each frame. This of course works with enlighten so it may be what people really want, not least because they don't have to endure huge bake times, and it works perfectly with realtime lights. There is potentially a higher memory cost, but there are plenty of ways to reduce this.

    Also solves perf problems in open world games.

    Shouldn't you be asking for something modern like that?
     
  40. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I am very disappointed, i hoped it would accelerate Enlighten.
    Enlighten is so slow.

    Why this would reduce Enlighten baking ?
    If Unity don't make happen shadow buffers, mixed mode is better than nothing at all.
     
  41. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    I hope you aren't talking about "not re-rendering shadowmaps if nothing moved".
    Because this isn't news, and even if you don't re-render shadowmaps, you'll still need to re-blend the lights every frame.

    Nope. First, provide basic stuff, then go advanced.

    Otherwise it'll be the same situation as it is right now with enlighten. Very advanced static lighting system, except that dynamic objects pretty much can't interact with it. Not having a shadow is VERY noticeable.
     
    zenGarden likes this.
  42. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    112
    "Pretty sure Unity has heard this thread :)"

    @hippocoder
    Sure would be nice for Unity to communicate with us... over a year and no fix and no comment on when we can look forward to a fix. I realized giving dates and missing them is really bad but come on... more than a year... on an "priority" bug.

    My game is dependent on this either working or not. A direction to travel in would be nice even if it isn't the answer I want. I could spend months solving this issue only to have them get around to fixing this. for me that means a lot of wasted work and a game that could have had a better lighting solution.
     
    a_tarerra and ArachnidAnimal like this.
  43. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    It is like any features, if you are too much dependent, if your game is for PC platform, you can just change engine for this project instead of waiting another year. This is disappointing, let's wait and see if the feature will become available once 5.4 becomes officially available.
     
  44. CPP_Meister

    CPP_Meister

    Joined:
    Sep 10, 2015
    Posts:
    8
    It's a shame.
    The Unity's silence about this make it worse ! What should we do ? Make a post a day here until a team member shows up ? You know what, i'm going to do that.

    Bump n°1 : 01/04/2016 : To Unity Team : When will mixed mode going to be fixed ? We need a date, it's been too long ! Please clarify the situation !

    A little reminder for all, don't forget to add a vote for this issue : https://issuetracker.unity3d.com/is...ic-objects-in-scenes-with-lights-set-to-mixed

    See you tomorrow for the second bump.
     
  45. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
    This will only get the thread locked.
     
  46. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
  47. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,327
  48. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    If i would GI and real time lights on some prototype game and it still does not come to Unity , i'll simply make a try with UE4 or CryEngine Svogi.
    Anyway there was light probes grid system for 5.4, it is coming ?
     
  49. Hjeldnes

    Hjeldnes

    Joined:
    Jul 22, 2012
    Posts:
    116
    From beta release notes.

    "GI: Light Probe Proxy Volumes
    This component allows using more than one light probe sample for large dynamic objects (think large particle systems or important characters). This will sample probes into a 3D texture and use that in the shader.
    • Requires shader model 4 (DX11+/PS4/XB1/GLCore)."
    So yep, it should be in the beta. The lighting you get from lightprobes are still kind of broken (inverted/darkened lighting). There are a few big threads about it here.
     
    zenGarden likes this.
  50. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    That's sad.
    It is like Lightening in Unity will stay problematic forever :(
    UE4 and CryEngine are different ways of lightening with disadvantages and advantages, but they just work great.