Hi all,
We’ve been working hard on addressing issues around mixed lighting and have made the latest iteration of these improvements available in Unity 5.6 Beta 2. The team is looking forward to hearing your feedback on lighting modes so please direct all feedback here in this thread so we can iterate on this together.
The work in progress documentation for this feature can be found here: [5.6 BETA] Light Modes - Google Docs
Overview
The goal we are striving for is to provide a much more robust, intuitive way for Unity users to light their scenes using a mix of baked lightmaps and realtime lighting/shadows. This is being done with the following features in 5.6 Beta 2:
-
The old Realtime, Mixed, Baked modes on lights in Unity have been changed to be Dynamic, Stationary, and Static. See the Lights section below for more details.
-
We have introduced a new set of Stationary Lighting Modes that offer a set of well-defined lighting solutions targeting different use cases and hardware. See the Stationary Lighting Modes section below for more details.
-
The Lighting panel itself has undergone a major overhaul and refresh as well as the Mesh Renderer and Light Component Inspector panes. See the User Interface section below for more details.
-
We have introduced a new editor panel called the Light Explorer which gives users quick access to Lights, Reflection Probes, Light Probes, and Emissive materials. See the Light Explorer section below for more details.
Lights
Lights can now be set to the following Modes:
- Dynamic (Previously Realtime)
- Stationary (Previously Mixed)
- Static (Previously Baked)
Dynamic lights cast dynamic light and shadows. They can change position, orientation, color, brightness, and many other properties at run time. These are the most flexible type of lights and can be used for Realtime Global Illumination. Dynamic lights compute direct lighting at run time. They also use realtime shadows via shadow maps. Enabling Realtime Global Illumination in the Lighting panel will cause Dynamic lights to contribute realtime indirect lighting to the scene. Indirect light is from realtime lightmaps and Light Probes updated by Enlighten.
Stationary lights allow a mix of dynamic and baked lighting based on the Stationary Lighting Mode set in the Lighting panel. All Stationary Lighting Modes except for Subtractive compute direct lighting at run time and store indirect lighting in lightmaps and Light Probes. Subtractive mode will compute direct lighting at bake time but only for Static objects. Stationary lights are affected by the Stationary Lighting Mode that is set for the scene. See the next section on Stationary Lighting Modes for more information.
Static lights cannot move or change in any way during run time. All lighting for static objects is baked into lightmaps. Lighting and shadows for dynamic objects gets baked into Light Probes.
Stationary Lighting Modes
Stationary lights can be controlled by scene wide Lighting Modes which instruct the lighting system on how direct lighting, indirect lighting, and shadows get handled by the various lights in your scene. The available modes for Stationary lights are:
-
Baked Indirect
Stationary lights contribute realtime direct light and use lightmaps and Light Probes for indirect light. Realtime shadows are used up to the Shadow Distance quality setting. -
Distance Shadowmask
Stationary lights contribute realtime direct light and use lightmaps and Light Probes for indirect light. Realtime shadows are used up to the Shadow Distance quality setting. Beyond this, Static objects use shadowmasks and Dynamic Objects receive shadows via occlusion from Light Probes. -
Shadowmask
Stationary lights contribute realtime direct light and use lightmaps and Light Probes for indirect light. Static objects cast shadows on themselves using shadowmasks. Dynamic objects cast shadows in the scene using realtime shadow maps up to the Shadow Distance quality setting. Dynamic objects receive shadows from statics objects from Light Probes occlusion. -
Subtractive
Stationary lights contribute indirect light through lightmaps and Light Probes. Direct light is handled with lightmaps for static objects and dynamic objects are direct lit in realtime. Static objects receive shadows from dynamic objects using approximate realtime shadow maps from the main directional light up to the Shadow Distance quality setting. Dynamic objects receive shadows from themselves using realtime shadows up to the Shadow Distance quality setting. Dynamic objects receive shadows from static objects from Light Probes.
These overview descriptions are presented as information tips in the Lighting panel now to help you get a better idea of the Lighting Modes within the editor context.
User Interface
We have made a lot of changes to the Lighting panel as well as the Inspector for Mesh Renderer and Light components that is outlined below.
Lighting Panel
The Lighting Panel has undergone a complete overhaul to improve the usability and provide a more intuitive approach to lighting going forward. The following changes have been made:
-
The panel has been organized in a way where sections can be collapsed when not needed and all relevant properties for a given section exist within the collapsible frame.
-
Labels and their tooltips have been re-done to be more user-friendly and informative.
-
A new Statistics panel has been integrated into the bottom of the Lighting panel which gives you a quick overview of lighting related statistics in the scene.
- Lightmaps tab has been renamed to “Global Maps” and now includes maps such as Intensity, Directionality, Shadowmask, etc.
-
The “Object” tab has been refactored and renamed “Object Maps”. This tab shows the currently selected objects baked texture previews. You can pan and zoom around in this view as well as use the ‘f’ hotkey to frame on a selected objects lightmap UVs in the tab. Properties previously found in the “Object” tab have been relocated to their appropriate component Inspector. The following views are available:
-
Charting
-
Albedo
-
Emissive
-
Realtime Intensity
-
Realtime Direction
-
Baked Intensity
-
Baked Direction
-
Baked Shadowmask
Inspector
As part of the Lighting panel overhaul the Objects tab in the Lighting panel was refactored and all lighting related properties were distributed back to the respective components.
Mesh Renderer components now have a foldout section labeled Lighting and all properties that affect how the mesh will interact with the lighting system are stored in there. Enabling the Lightmap Static property will mark the object as Static (same flag in the Static dropdown list) to be used in lightmap calculation. This also exposes the various other properties related to lightmapping.
Light components have also been refactored to include the new light modes (Dynamic, Stationary, Static) and have had a pass to make the labels more user-friendly. We’ve also done a pass over all of the tooltips to make them more informative to users on what a specific property does.
Light Explorer
The Light Explorer is a new interface in Unity 5.6 Beta 2 that allows you to view and edit every light in the scene. This is very useful for large, complex scenes where you may have lights scattered across your hierarchy that you want to tweak. There are four tables in the Explorer that allow you to tweak Lights, Reflection Probes, Light Probes, and Emissive Materials. Each table is searchable to help find specific objects you want to work with and you can also Lock Selection which will maintain the items currently selected in the view even if your scene selection changes. The tables also support multi-editing by selecting multiple items and editing a value which will set the value across all selections in the table.