Realtime Resolution

Checked with version: 5.5

-

Difficulty: Intermediate

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.

description

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.

Graphics

  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. 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. Cameras
  2. Image Effects: Overview
  1. Meshes
  2. Mesh Renderers and Mesh Filters
  1. Where to Start?
  2. Preparing Unity Render Settings
  3. Lighting Strategy
  4. Modeling
  5. Standard Shader/Material PBS and texturing
  6. Lighting and Setup
  7. Understanding Post Process Features
  8. Dynamically Lit Objects
  9. Sample Project File
  1. Using Cameras
  2. Using Lights
  3. Fun with Lasers!
  4. The Particle System
  5. Cinematic Explosions - PIT
  6. Cinematic Composition - PIT
  7. Image Effects: Overview
  8. Fun with Explosions!
  9. Exploring the Blacksmith Environment
  1. Turning it up to 11: Making Unity 5 look Awesome!
  1. Substance - Introduction
  2. Substance - Understanding PBR
  3. Substance - Working with PBR in Unity
  4. Substance - Using Substance materials in Unity
  5. Substance - Optimization for Substance materials
  6. Substance - Creating rock shapes
  7. Substance - Creating rock material, Pt 1
  8. Substance - Creating rock material, Pt 2
  9. Substance - Creating the dirt ground material
  10. Substance - Creating the rock ground material, Pt 1
  11. Substance - Creating the rock ground material, Pt 2
  12. Substance - Publishing the Substance
  13. Substance - Creating a blocking scene
  14. Substance - Creating the ground model
  15. Substance - Modelling the rock assets
  16. Substance - Texturing the upper body
  17. Substance - Exporting textures from Substance Painter
  18. Substance - Creating a scene in Unity, Pt 1
  19. Substance - Creating a scene in Unity, Pt 2
  1. Introduction and Goals
  2. Flame Particles Overview
  3. Particle Emission and Color
  4. Adding Movement To Particles With Noise
  5. Creating The Ember Particles
  6. Adding Lighting To Particles
  7. Creating Sparks With Particle Trails
  8. Particle Question and Answers
  1. Introduction and Goals
  2. Adding a Second Camera
  3. Adding Minimap Icons
  4. Render Textures and UI
  5. Adding A UI Mask and Border Image
  6. Questions and Answers
  1. Session Introduction
  2. Rendering In Unity
  3. Anatomy Of An Unlit Shader
  4. The Vertex Function
  5. The Fragment Function and Color Tint
  6. Making A Transparent Shader
  7. Displacing Vertices and Clipping Pixels
  8. Questions and Answers
  1. Introduction and Session Goals
  2. The VideoPlayer Component
  3. Texturing Objects With Video
  4. Playing and Pausing
  5. Playing A New Clip
  6. Displaying Current Time and Clip
  7. Animated Playhead
  8. Questions and Answers
  1. Overview and Goals
  2. Tonemapping and Color Grading
  3. Camera Movement & Animation
  4. Post Processing Volumes
  5. Timeline & Cinemachine
  6. Questions and Answers