Lesson 95 +10 XP

Reflection Probes

Reflection Probes

Reflection Probes capture a 360-degree view of their surroundings and store it as a cubemap, which is then applied to reflective surfaces nearby. They provide accurate, scene-specific reflections.

Why Reflection Probes?

Without probes, Unity uses a default skybox reflection on all surfaces. Reflection probes provide:

  • Accurate reflections of local scene geometry (walls, floors, objects).
  • Different reflection environments in different zones (indoors vs outdoors).

Creating a Reflection Probe

  1. Go to GameObject > Light > Reflection Probe.
  2. Position the probe in the center of the area you want to reflect.
  3. Set the Type:
  • Baked: Captures reflections at bake time. Best for static scenes.
  • Realtime: Captures every frame (expensive) or on demand.
  • Custom: Uses a user-supplied cubemap.

Baking Reflection Probes

For baked probes:

  1. Mark surrounding static objects as Reflection Probe Static.
  2. Open Window > Rendering > Lighting, scroll down to the Environment section.
  3. Click Generate Lighting (or the individual Bake button on the probe component).

The probe stores a cubemap asset in the scene folder.

Probe Blending

When a reflective object moves between two probes, Unity can blend between them:

  • Set Reflection Probe Blending in the camera or project settings.
  • The object's renderer must have Probe Usage set to Blend Probes.
// Control probe blending per renderer
Renderer rend = GetComponent<Renderer>();
rend.reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.BlendProbes;

Runtime Realtime Probes

using UnityEngine;

public class RealtimeProbeController : MonoBehaviour
{
    [SerializeField] private ReflectionProbe _probe;

    void Update()
    {
        // Render the probe every frame (expensive -- use sparingly)
        _probe.RenderProbe();
    }
}

TL;DR

  • Reflection Probes capture a cubemap snapshot of local surroundings for reflective materials.
  • Baked probes are captured offline; Realtime probes update at runtime (expensive).
  • Enable Blend Probes on renderers for smooth transitions between probe zones.
  • Mark objects as Reflection Probe Static before baking for accurate results.