Before starting to create final Assets and approach lighting for a Scene, you need to figure out your lighting strategy. Altering your lighting strategy late in development has a high impact on your workflow. Taking the time to get this right before you enter production saves time overall, and allows you to achieve better performance and higher visual fidelity.
As with all development, there’s almost always a trade-off between the benefits and impacts of one setup over another. There are times, however, where certain technologies give you options to mitigate these trade-offs within specific constraints. Knowing each feature’s trade-offs allows you to choose what’s best for your project.
A typical daytime Scene with outdoor areas has the following lighting components:
This seems like three simple components. But because you can mix and match Realtime lights, Mixed lights, Baked lights, static GameObjects and dynamic GameObjects, you can end up with a diverse range of lighting options.
Unity caters to lots of different lighting strategies and project scenarios. To understand lighting modes and setup, see documentation on Lighting Modes.
For newcomers, it can be overwhelming to figure out which setup works best for their Scene, and what the trade-offs are. So let’s consider the most commonly used lighting setups:
The following images show the notable differences between these setups:
Note: Realtime GI can’t bake static ambient occlusion, so it’s not included.
Basic real-time lighting is generally used in stylistic visual projects and prototype phases.
Typical platform target: Console and PC
Ventajas:
Desventajas:
Baked lighting is generally useful for games where run-time performance is an issue but there’s room in memory, such as top-down isometric mobile games and high frame-rate VR games.
Typical platform target: Mobile platform, VR, console and low end PC
Ventajas:
Desventajas:
Mixed lighting is often useful in games where time-of-day lighting (such as sun movement) is not important.
Typical platform target: VR, console and PC
Ventajas:
Desventajas:
For more information on Shadowmask lighting, see Shadowmask.
This setup is useful in open area games where you need time-of-day lighting updates (such as the sun moving) and dynamic lighting effects.
Typical platform target: Console and PC
Ventajas:
Desventajas:
For in-depth information on optimizing Realtime GI, see Unity’s tutorial on Introduction to Precomputed Realtime GI.
You would only want to generally enable all lighting options in games with high fidelity requirements that have tightly controlled memory usage and performance limits. You should only do this if you fully understand each individual system, and know how to handle each lighting combination.
Typical platform target: Console and PC
Ventajas:
Desventajas:
To help you learn about lighting, the Spotlight Tunnel Sample Scene uses real-time lighting with Realtime GI. This provides a diverse range of specular responses, good bounce lighting, and allows you to quickly iterate on lighting.