Loading lessons...
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
- Go to GameObject > Light > Reflection Probe.
- Position the probe in the center of the area you want to reflect.
- 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:
- Mark surrounding static objects as Reflection Probe Static.
- Open Window > Rendering > Lighting, scroll down to the Environment section.
- 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.