Realtime Resolution

Revisado con versión: 5.5


Dificultad: Intermedio

When setting up a Scene for lighting using Precomputed Realtime GI, one of the first decisions that needs to be made is to determine your Scene’s default Realtime Resolution. Realtime Resolution is the number of realtime lightmap texels (texture pixels) used per world unit.

Realtime Resolution can be observed or set in the Lighting window, as follows:

  • Open the Lighting window (Window > Lighting) and then select the Scene tab.

  • Ensure Precomputed Realtime GI is enabled by checking the Precomputed Realtime GI checkbox.

  • Observe the Realtime Resolution property beneath the Precomputed Realtime GI checkbox.


Unity’s Lighting window showing the Scene’s global Realtime Resolution setting.

Choosing an appropriate Realtime Resolution

When setting up a Scene it is important to have some idea of the unit scale your project will need. It could be that in your project a unit is a meter, a foot or a centimeter. Unity units do not have a default equivalence in real world scale so it it down to the user to decide what a unit represents.

In our example project we have decided that a unit is equivalent to 1 meter. Certain physics concepts assume the same. For example, gravity is represented in units per second as a default in Unity. Assuming that a unit is equivalent to 1 meter is therefore a good setup for a real world game scenario.

Often your Scene’s Realtime Resolution can be determined from the scale of your game world. For example, is your Scene a small, but richly populated indoor environment with a lot of variance in the bounced lighting? In this case, higher lightmap resolutions such as 2-3 texels per unit might be justified in order to capture this more detailed or ‘high-frequency’ lighting.

Perhaps your Scene is a large outdoor environment where the world scale is considerably bigger. You might have surfaces that are hundreds or even thousands of units in area with little variation to modify the color of bounced light. In cases such as these, a resolution which is appropriate to capture the intricate lighting details present in an indoor Scene would be wasteful when applied across the large and less featured expanses of an outdoor environment. We would be wasting valuable CPU time and available memory by having to store and update lightmap texels which aren’t contributing much to the overall look of the Scene. More importantly, for the purposes of this tutorial, we would be increasing the number of lightmap texels that must be considered during the lighting precompute. This can have a huge impact on precompute times.

In the case of an outdoor environment, an appropriate lightmap resolution might be be somewhere between 0.5 -1 texels per unit for large objects within the Scene, or 0.1 - 0.5 texels for the terrain.

Precomputed Realtime GI Resolution vs. traditional lightmaps

The Realtime Resolution values needed by Unity’s Precomputed Realtime GI are orders of magnitude less than ‘traditional’ lightmap texel densities. This is because we are only capturing indirect lighting in these lightmaps, and this tends to be very soft or ‘low frequency’. When using Precomputed Realtime GI, crisp shadows will usually be provided by realtime shadows rather than high resolution lightmaps.

Using values which may seem appropriate in traditional lightmapping techniques - say 30 texels per unit - will likely result in precomputes failing or otherwise not completing. More suitable values are around 2 - 3 texels per unit for indoor Scenes, and 0.5 - 1 for outdoor environments. This is assuming that we are working with a human scale Scene with a unit size of 1 unit = 1 meter. If the world scale was substantially different, these values would need to be adjusted accordingly.

Scenario Realtime Resolution
Indoor 2 - 3 texels per unit
Outdoor 0.5 - 1 texels per unit
Terrains 0.1 - 0.5 texels per unit

Appropriate values assuming a human-scale world with 1 unit representing 1m.

When initially setting our Scene’s Realtime Resolution, we are specifying the default resolution for Static objects within our Scene. New GameObjects with a MeshRenderer marked as Lightmap Static at the top of the Inspector will use this value until otherwise modified.

In addition to choosing the Realtime Resolution for the entire Scene we also have the option to change lightmap resolution on a per-object basis. In cases where we need the extra fidelity offered by higher resolutions, we can selectively increase this value. Generally it is less work to set the most common resolution as the Scene default and then manually raise the resolution on those objects which need more lighting detail. We will discuss approaches to modifying resolution per-object later in the tutorial.

Setting our Scene’s Realtime Resolution

If you want to follow along, we will be working in the LightingTutorialStart Scene included with the Lighting Optimisation Tutorial linked at the top of this page.

In our example Scene, we have an outdoor environment with a medium size terrain of a reasonably consistent color. For this, a low Realtime Resolution of 0.5 texels per unit would be sufficient to capture the bounced lighting from other objects in the Scene. However, there are also a number of wooden houses. These are much more detailed. As there are many more houses than there are terrain objects in the Scene, we should set the Realtime Resolution to be appropriate for the houses. We can then modify the resolution used by the terrain objects individually. This will reduce the amount of work needed when preparing our Scene. With this in mind, we are going to use a value of 1 texel per world unit for our default Realtime Resolution.

  • Open the Lighting window (Window > Lighting) and select the Scene tab.

  • Set the Realtime Resolution value to 1.

Given that we have decided our Scene’s scale to be 1 unit = 1m, this means that a single lightmap texel created by Unity’s Precomputed Realtime GI will be equivalent to 1x1m in size. This might seem very low, but remember that we are only capturing the indirect light. Crisp shadows and specularity from direct lighting will be provided by realtime lights in the Scene.

Unity For Artists

  1. Lighting Overview
  2. Lights
  3. Materials
  4. The Standard Shader
  5. Textures
  6. Using Skyboxes
  7. A Gentle Introduction to Shaders
  8. Using detail textures for extra realism close-up
  9. Frame Debugger
  1. Introduction to Lighting and Rendering
  2. Choosing a Lighting Technique
  3. The Precompute Process
  4. Choosing a Rendering Path
  5. Choosing a Color Space
  6. High Dynamic Range (HDR)
  7. Reflections
  8. Ambient Lighting
  9. Light Types
  10. Emissive Materials
  11. Light Probes
  1. Introduction to Precomputed Realtime GI
  2. Realtime Resolution
  3. Understanding Charts
  4. Starting the precompute process
  5. Probe lighting
  6. Unwrapping and Chart reduction
  7. Optimizing Unity's auto unwrapping
  8. Understanding Clusters
  9. Fine tuning with Lightmap Parameters
  10. Summary - Precomputed Realtime GI
  1. The Particle System
  2. Adding Lighting To Particles
  3. Adding Movement To Particles With Noise
  4. Fun with Explosions!
  5. Cinematic Explosions - PIT
  1. Intro to Timeline and Cinemachine Tutorial (including Dolly Track)
  2. Intro to Timeline [ by Brackeys ]
  3. Intro to Cinemachine [ by Brackeys ]
  4. Cinemachine Clear Shot Camera Tutorial
  5. Using Timeline: Getting Started
  6. Using Timeline: Understanding Tracks
  7. Using Timeline: Working with Animation Clips
  1. Materials
  2. Emissive Materials
  3. How to remove lighting from Photogrammetry with the De-lighting tool
  1. Introduction to Art & Design Essentials
  2. Uber Standard Shader Real Time Snow Effect
  3. Building Levels With Octave3D
  4. Volumetric Fog with Fog Volume 3
  5. Questions and Answers for Art & Design Essentials
  1. Overview and Goals
  2. Best Practices
  3. Mesh Normal Calculation
  4. DCC Tool Light Import
  5. DCC Tool Camera Import
  6. Importing Visibility Animation
  7. Animation Keyframing Improvements
  8. Stingray PBS Materials
  9. FBX Material Embedding
  10. Questions and Answers