Complex Lighting Setup in Enlighten

Because of issues we’ve had with the Beast Lightmapper in the past, my dev team is really looking forward to Enlighten. Still, while we’ve begun our own explorations in the Unity 5 beta, I wanted to ask here on the forums and get some insight in the best way to play with the new Enlighten system that will fit our needs.

The first question I’d like to ask is how does Enlighten play with GameObjects being enabled & disabled. We do a bit of manual occlusion culling by turning GameObjects on and off. We do this since since we’re hoping to target hardware that doesn’t support Unity’s internal system. (The internal system, like Unity 4’s shadows, relies on GPU and we have to target hardware that is running pretty weak, motherboard based video cards.)

Now, beast had trouble with this because when we tried to bake our lighting just through the “Bake Scene” option, we would get “Shadow Blead” where things were casting shadows where, because of our occlusion, they would not. (We have some sets of the level stacked on top of one another due to the nature of the game.)

The second question is how Enlighten would play with a situation like the one pictured below.

In this example, the outdoor area on the right will have a late-afternoon to dusk lighting while the area on the left side will need to have nighttimelighting. This change needs to occur while the player is in the tunnel, visible in the middle. The tunnel is entirely enclosed, but even then we were having trouble with Beast lightmapper and bleading light where, the moment you opened a door on either end of the tunnel, the lighting was snapping to change to the new are. (We couldn’t have dynamic directional lights because of our min spec desires.)

Now, this is the part we’ve been able to test and the new Enlighten system seems to play with this situation very well, but we’d still like some insight in how to best handle this situation where we’ll need to be changing the “outdoor” lighting while the player is inside an enclosed “indoor” space/transition area.

My third and final question s in regards to Enlightenin’s realtime shadow rendering. How does it compare, performance wise, to Unity 4’s realtime lighting solution. If it’s significantly better, a lot of our concerns relating to baked light maps would disappear, to a degree, since we may be able to run the scene with more dynamic and less static lighting.

So, again, any insight that can be provided into this new system would be greatly appreciated .

1.) If you were going with the realtime option for Enlighten I’d assume you could just change the main light color to something a bit more nighttime-ish (might also involve a function call to force Enlighten to update?)
2.) The shadows are totally separate from Enlighten. Enlighten only computes the indirect lighting, nothing more.

The occlusion culling system is running on the CPU, is supported on all the devices and you should try to use it.
We use shadow mapping for realtime shadows and in Unity 5 the performance should indeed be better.

Enabling objects
Objects that were not present in the Editor at precompute/bake time can still use the GI system (baked or realtime) via light probes. That was the case in 4.x too though (for baked GI).

Disabling objects
Baked GI still produces lightmaps and those won’t change if you disable an object at runtime.

Realtime GI does a precompute on static geometry in the Editor, so disabling just one object will not make it disappear from Enlighten’s perspective. Technically it would be possible to unload specific Enlighten systems* to make certain groups of objects not affect other objects, but an API for that is not exposed yet.

What you can do now is change the albedo/emissive properties of specific renderers if you want them to not bounce/emit light into the rest of the scene.

*) (groupings of objects, check the “GI - Systems” scene view visualization)

I’m not sure I understand the snapping issue. Anyway, as soon as you bake the lighting the only thing you can do is to switch (or blend over time) to another set of lightmaps / light probes.

What was the problem in that case? If the enclosed area is really enclosed then none of the outdoor lighting should reach it. At least at bake time when the doors are closed.

As PhobicGunner already mentioned Enlighten is “only” responsible for realtime and baked GI. Shadows are still handled entirely by Unity, but there are both quality and performance improvements coming there in Unity 5.

That said, if you want to have some occlusion in your scenes you could consider lighting your levels with ambient lighting coming from the skybox only. That might alleviate the need for a directional light with shadows.
Using realtime GI shouldn’t affect the framerate of your game. The only thing that will be affected by the speed of your target hardware is the rate of indirect light updates.