Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Intent of 'Mixed' Baked mode for lights? (Case 671248)

Discussion in 'Unity 5 Pre-order Beta' started by seattlebluesky, Dec 14, 2014.

  1. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    In Unity 4 a 'seemingly' equivalent value on lights was Lightmapping mode set to 'Auto' which caused the light to behave as a 'Realtime' light within the shadow distance when using dual lightmaps, and a 'Baked Only' light outside of this distance.

    In Unity 5 what is the intent of Baked mode set to 'Mixed'?
     
  2. AhrenM

    AhrenM

    Joined:
    Aug 30, 2014
    Posts:
    72
    I'm not sure of the intent (and I'm happy to be corrected) but setting my scene 'sun' directional light to mixed had an additave effect, ie bake AND realtime. Things got very very bright.

    Might have been a dodgy setup, I'm a bit noob when it comes to lighting.
     
  3. fueldown

    fueldown

    Joined:
    Aug 21, 2012
    Posts:
    15
    As far as I know, this mode lets you use the real-time lighting on the baked maps as well. So if you have a ground objects that are baked and your player object has got real-time shadows, setting the light to mixed mode will let the player shadows to be cast on baked ground objects.
     
  4. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    My question is whether the functionality provided by the Lightmapping mode in Unity 4 with dual lightmaps is expected to work in Unity 5 b 17 albeit in some other guise.

    From my testing I see no difference in the handling of shadows and lightmapping between a Unity 5 light's Baking mode of Baked and Mixed.
     
  5. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    Anyone? Is it expected that come Ship for 5.0 that Mixed will provide similar functionality as provided by dual lightmaps in 4.0? Currently there is no, to the best of my knowledge, functional equivalent in 5.0 Beta to 4.0's dual lightmaps feature. Or is there?
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    5,609
    I think the intent is that the Direct Lighting will be realtime and the indirect will be baked. Which isn't exactly the Dual Lightmapping equivalent.
     
  7. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    Currently this appears to be non-functional. It is Beta of course, but it'd be nice to know for sure what the future plans were.
     
  8. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    401
    Dual Lightmaps as you know them are gone in 5.0.

    When a directional light is marked as baked then it affects static objects via lightmaps and dynamic objects via light probes. The dynamic object doesn't cast a shadow for this light onto the static lightmapped object nor other dynamic objects.

    The Mixed mode allows for mixing lightmaps with realtime shadows, so that dynamic objects can cast realtime shadows onto static lightmapped objects (even though those objects already have the contribution from that light in the lightmap) and that dynamic objects are affected by this light in realtime.

    This mode on the light will most likely be separated out into another toggle, as it's confusing in the current state.

    There is still some work to be done in this area before we ship 5.0 and improvements will come soon in the cycle as well.

    That said, if you have a directional light and you can afford to use a big enough shadow distance, the setup with realtime GI is just more simple and doesn't have all the corner cases of the one above.
     
    Pokuke, protopop and seattlebluesky like this.
  9. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    @Kuba , thanks for the update. Understood that dual lightmaps are gone just need the mixed mode realtime shadows on baked scenes. Looking forward to it working in some future Beta. Cheers.
     
  10. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    Same. Kinda weird that I use mixed mode with point lights and I get no shadows on characters.
     
  11. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    137
    I'm getting static lightmapped objects casting realtime shadows onto static lightmapped objects, is that expected? Can I prevent that somehow?
     
  12. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    401
    No, that is not expected. Please submit a bug report with a repro.
     
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    I think I know why I'm not getting shadows. The GI in my scene is pretty much killing my shadows...
     
  14. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    137
    Scratch that, turns out there were duplicate meshes, which were not set to static, underneath the static lightmapped stuff. All sorted now.
     
  15. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    Does a light's Mixed baking mode now allow for dynamic shadows cast from non-static objects in RC1? For Beta 22 Realtime baking mode lights allow runtime shadows to be cast by non-static or static objects. Baked baking mode lights cause shadows to be baked by static objects only, i.e. at runtime non-static objects do not cast shadows for those lights. Mixed baking mode lights seems to behave the same as Baked baking mode lights with respect to the shadows cast.
     
  16. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    So RC1 happened. I am so unsure if we'll ever see dynamic shadows mixed with lightmap data. At this point I am clueless as to what Mixed baked mode does for lights with RC1. I'm a total n00b with this stuff so it could well be my chronic mis-understanding of how it works in RC1.
     
  17. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    Reported as case from 4.6. Reason being that it, at least in my testing, was reliable to verify it worked in 4.6 and then import the project to 5.0 and re-bake.

    Case 671248.

    1) What happened?

    Shadows do not seem to be cast by non-static objects that are lit by Mixed bake (Auto in 4.6) mode lights.

    2) How can we reproduce it using the example you attached?

    - In 4.6.2f1 open up either of the two projects.
    - Bake each using the default settings.
    - Play.
    - Notice the 1 or 2 shadows (depending on project) cast by the non-static spheres onto the ground plane.

    - Now go to 5.0.0f1 and convert the two projects.
    - Bake each using the converted settings.
    - Play.
    - Notice that the spheres do not cast shadows.

    Strangely I thought I saw this work once, i.e. have shadows cast by the spheres, in 5.0.0f1 but could not get back to that state either through re-baking given a deleted GI cache or baked data.
     
  18. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    @Joachim_Ante these are captures from the project 'DynamicShadows 4.6.2f1 (2 lights)' in the Case 671248 submission.

    Screenshot in Editor of baked scene in 4.6.2.f1.
    upload_2015-2-11_9-32-27.png

    Same project imported to 5.0.0f1 and re-baked with imported settings. Note the missing shadows cast from spheres.
    upload_2015-2-11_9-33-7.png
     
  19. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    It must be me because nobody else has yet to say 'hey, that happens to my scenes too when I bake light maps in and render in deferred lighting mode and I want to see dynamic shadows!'. But to make it super simple for folks to verify here's the project attached.

    - Open in Unity 5.0.
    - Accept offer to Upgrade project.
    - Open up 'Default' scene.
    - Note the realtime shadows from spheres rendered in the Editor view.
    - Bake light-map using imported settings.
    - Note the realtime shadows from spheres are now gone.

    If anyone sees realtime shadows in Unity 5 then I'd love to know where I'm going wrong with my scene settings. If everyone sees what I see then it's a regression from Unity 4.6 w.r.t. lighting capabilities.
     

    Attached Files:

    Last edited: Feb 13, 2015
  20. lightassassin

    lightassassin

    Joined:
    Mar 29, 2013
    Posts:
    45
    I just submitted a bug report. Found this before posting myself, yeah I am getting the same on Windows 7/8.1 with 5.0 RC1. No shadows when using Directional Specular.

    I am using real time only at the moment, so I hadn't noticed until I was doing a test bake for another project. =\
     
    seattlebluesky likes this.
  21. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    Good to know my case isn't a unique one.
     
  22. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    Repro'd in RC2 and the original case 671248 is Open with no comments. Is this something that will work for Unity 5.0 ship? I'm more than happy to re-build my scene with realtime lights where appropriate and ignore the Mixed/Auto mode for them if it won't work but I'd love to know what the future holds with this.
     
  23. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,169
    I desperately need to know what is going on with this stuff, what is supposed to work once 5.0 is released, what is planned for later on, whether apparent bugs are being acknowledged and worked on or not when it comes to this shadow stuff in mixed mode.
     
  24. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,169
    I'm going to keep asking. Please could someone from Unity let us know what is going on with this stuff. Forgive my sense of urgency, but I'm only weeks away from needing to get a pre-alpha demo of a project going, and I have to make lighting decisions rather soon.

    Specifically, I need to know if any release candidates in the next few weeks are going to offer dynamic object shadows cast onto static objects when lights are in mixed mode. And not just directional lights, but point lights.
     
  25. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,561
    All I really want from this release is the 64 bit editor. PBR, GI and other acronyms are probably cool for the future, but I'm not really sure how important they are to the average developer who isn't recreating crysis 3 in their basement.
    I'd just like to have lighting that works like 4.X does:

    http://docs.unity3d.com/Manual/LightmappingInDepth.html

    Go down the page about halfway, under Dual Lightmaps. That's what I really want from lighting - Lightmaps, and realtime shadows that blend into them.

    Is that the intent of mixed mode lighting?

    Will we see this in the 5.0 release?

    Because if I bake lightmaps right now, I don't get realtime shadows.
     
  26. andybossa

    andybossa

    Joined:
    Feb 19, 2013
    Posts:
    5
    I've read of a workaround to this where you simply use two lights instead of one. A baked and a realtime in the same place. This sounds like it'll mimic the workflow for lighting in 4.x.

    I'm eagerly awaiting a more robust workflow then this, either that or some documentation to give an example of how it should be done ;)

    Either way it's frustrating that enlighten has totally pushed out beast at this time as it still feels like enlighten isn't as 'finished'
     
  27. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,169
    It makes me very happy to see people from Unity providing good, current information on other threads. I hope it happens to this one soon too.
     
    shkar-noori likes this.
  28. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    @andybossa two lights with 1/2 the desired intensity?
    My suspicion is that this Baked vs. Realtime vs. Mixed mode won't happen for 5.0. If it was going to I think we'd have heard something on this thread by now.
     
  29. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,561
    On the other thread, I tested and reported my results: It doesn't work.

    The only thing that works is reverting to "legacy deferred" mode. An acceptable substitute (if you don't mind shadow overlaps) is to just use forward rendering.
     
  30. lightassassin

    lightassassin

    Joined:
    Mar 29, 2013
    Posts:
    45
    I had a response from QA today in regards to my bug report and they were able to recreate it. So hopefully some news on that front. I replied with more details as I have done a fair bit of extra testing since the first report.

    I have tested so many modes (DX9, DX11, force opengl) on both Windows 7 and 8. Along with 64 bit and 32bit editor and stand alone builds in both Gamma and linear space. Just wanted to see what actually effected it.

    Mixed mode lights only appear to work in Forward and Legacy Deferred with Non-Directional and Directional bakes so far (Directional Specular does not). No mixed mode baked lights work with dynamic object shadows in the new Deferred mode at all.

    They did point out that Directional Specular does not work with SM 2.0, but I don't believe that is my issue with my hardware/os/drivers. I am currently just working in real time while developing, but it would be nice to pre-bake as much as possible for performance concerns for lower end hardware.
     
  31. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,169
    I am unhappy that we havent been treated to an updated answer on this one. So I'm going to ask again, although sadly I dont expect an official response, especially with GDC imminent.

    I'll have to assume that this feature remains quite broken, at least under certain rendering configurations, and will start experimenting with workarounds rather than assuming anything on this front will be improved for 5.0.0.
     
  32. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    You guys tried the latest RC3 Build?
     
  33. lightassassin

    lightassassin

    Joined:
    Mar 29, 2013
    Posts:
    45
    The QA person I got a reply from said he/she would get back to me with an answer be it a bug fix, a commitment to bug fix in future versions, or a reply from the devs saying "Not supported".

    I asked about all modes (Forward, Legacy Deferred and Deferred), so hopefully when I get a reply it covers all of the modes involved and I'll update this post with what I am told.

    edit: Tested on RC1/2/3 :)
     
  34. SpiriTx

    SpiriTx

    Graphics QA Unity Technologies

    Joined:
    Apr 12, 2012
    Posts:
    251
    Hi,

    As elbows guessed lightmapping devs are insanely busy with GDC right now, so I'll try to answer this as best as I can.

    I've found that we already have few bugs on Mixed lights in the system, but I've added seattlebluesky case as a duplicate, so that it also gets checked when fix is added. It's not yet fixed in Rc4, but cases are marked as high priority.

    As far as I've checked shadows were present only in Forward mode.

    For a possible workaround, I'd recommend using Realtime for now as it will provide best results and should be way too much expensive than having 2 lights (baked and realtime)
     
    JuanQ and elbows like this.
  35. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,031