Uploaded by Jesse Voimala

Lighting, Reflections, and Light Probes in Unity

advertisement
LIGHTING, REFLECTIONS, AND LIGHT
PROBES IN UNITY
RESEARCH PAPER
1
1 Introduction
In this paper I will briefly introduce Lighting, Reflections and Probes in Unity. The Unity version
used for the examples varies between 2019.3, 2019.4, and 2019 LTS, but the theory applies to
newer Unity versions as well. I will first go through each topic individually, and finally at the end
summarize the effects of each topic - Lighting, Reflections and Light Probes - to a game’s visual
style and what are the benefits of using them.
2 Content
2.1 Terminology
Global Illumination, referred to as GI in this paper, means different techniques that simulate the
behavior of lights as it bounced from surfaces and objects. In Unity, GI can be configured in the
Lighting Window. (Configuring Global Environment Lighting Settings, 2021).
Level of Detail, referred to as LOD in this paper, means rendering a lower amount of triangles for
distant meshes in a scene improve the performance of your game. (Level of Detail for Meshes,
2021).
2.2 Lighting
2.2.1 Real-time Lighting
Realtime Lighting means that Directional, Spot and Point Lights in the scene calculate their lighting
in real time. In practice, this means that lighting is updated with every frame. Realtime Lighting is
often used for illuminating characters, movable objects, and other geometry that can be moved in
the game. Realtime Lighting is often more costly in terms of computing power required, compared
to baked lighting. (Introduction to Lighting and Rendering, 2021).
2.2.2 Baked GI Lighting
Baked GI Lighting means that the way light behaves in the scene is pre-calculated. The lighting is
applied to static objects in the scene. The baked shadows are written into a Lightmap in the Textures of the scene. Lightmaps can have data from both direct light and indirect light that bounces
2
from other surfaces. The downside of baked lighting is that it cannot change during gameplay. (Introduction to Lighting and Rendering, 2021).
2.3 Reflections
Reflections in Unity are handled with separate Reflection Probes. They are essentially 360-degree
cameras that that capture a view of their surroundings. The information of the probe’s surroundings is stored into a Cubemap, that can then be used by the scene’s objects that have reflective
surfaces. (Configuring Reflection Probes, 2021).
By default, reflective materials only reflect the Scene’s skybox. If you have a scene that has multiple objects surrounding a reflective material, you should consider using reflection probes to get
more realistic reflections. After you have set up a reflection probe in a scene, the probe will automatically communicate with the scene’s materials to create realistic reflections. (Configuring Reflection Probes, 2021).
2.4 Light Probes
Light Probes are used to add realistic lighting effects to objects, that move within the scene. Light
Probes store the information of how light behaves in a scene. This information can be used to add
high-quality light to moving objects or to provide lighting information for static scenery via Unity’s
LOD system. (Configuring Light Probes, 2021).
The placement of the light probes in the scene is important. You should aim to place Light Probes
at places where there is a change in lighting, for example at a transition point between light and
shadow in the scene. While they are not too expensive to compute, placing multiple of them does
not net much increase in the quality or variance of the sampling. (Configuring Light Probes, 2021).
3 Summary
Lighting, Reflections and Light Probes are all important factors in creating a realistic looking game.
The behavior of different types of lights in scenes, and more importantly for scenes with multiple
objects and reflective surfaces, is extremely complex. Calculating direct lighting, indirect light
3
bounces and realistic reflections all require a hefty amount of computing power and complex algorithms. Luckily, the free Unity tools discussed in this paper provide more accessible ways to not
only make your game look better, but also potentially run smoother by reducing computing power
requirements.
4
References
Unity Documentation. (2021, November 16). Level of Detail for Meshes.
https://docs.unity3d.com/Manual/LevelOfDetail.html
Unity Learn. (2021, November 16). Configuring Global Environment Lighting Settings.
https://learn.unity.com/tutorial/configuring-global-environment-lighting-settings-2019
Unity Learn. (2021, November 16). Configuring Light Probes. https://learn.unity.com/tutorial/configuring-light-probes#
Unity Learn. (2021, November 16). Configuring Reflection Probes. https://learn.unity.com/tutorial/configuring-reflection-probes-2019-3
Unity Learn. (2021, November 16). Introduction to Lighting and Rendering.
https://learn.unity.com/tutorial/introduction-to-lighting-and-rendering-2019-3
Download