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

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’?

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.

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.

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.

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?

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.

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.

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.

3 Likes

@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.

Same. Kinda weird that I use mixed mode with point lights and I get no shadows on characters.

I’m getting static lightmapped objects casting realtime shadows onto static lightmapped objects, is that expected? Can I prevent that somehow?

No, that is not expected. Please submit a bug report with a repro.

I think I know why I’m not getting shadows. The GI in my scene is pretty much killing my shadows…

Scratch that, turns out there were duplicate meshes, which were not set to static, underneath the static lightmapped stuff. All sorted now.

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.

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.

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.

  1. 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.

@Joachim_Ante_1 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.

Same project imported to 5.0.0f1 and re-baked with imported settings. Note the missing shadows cast from spheres.

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.

1961466–126968–DynamicShadows 4.6.2f1 (2 lights).zip (411 KB)

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. =\

1 Like