In this lesson, you will learn how to use Reflection Probes to capture environment cubemaps, allowing your metallic and glossy surfaces to reflect their surroundings accurately.
The Problem with Static Lighting
While Light Probes provide dynamic objects with indirect diffuse lighting, they don’t provide enough high-frequency detail for "specular highlights." If you have a polished chrome sphere or a wet floor, a simple light source isn't enough; the surface needs to know what the world looks like around it to create that realistic mirror-like finish. This is where the Reflection Probe comes in.
How Reflection Probes Work
A Reflection Probe acts as a "camera" inside your scene that captures a 360-degree spherical view (a cubemap) of everything around it. When a dynamic object with a metallic or smooth material moves within the influence of that probe, the shader uses that captured cubemap to calculate the reflection, resulting in those crisp, realistic highlights.
Setting Up Your Scene
- Create the Probe: In your Hierarchy, right-click and select Light > Reflection Probe.
- Define the Volume: The
SizeandBox Projectionsettings are critical. TheBox Projectiontoggle allows the probe to simulate local-space reflections, which makes reflections look like they are actually aligned with your room geometry rather than just wrapping the object in a flat skybox. - Configure the Capture: Under the probe settings, set the
Refresh ModetoRealtimeif the environment is changing (like opening a door), orBakedif your environment is static to save on performance.
Scripting for Dynamic Updates
If you need to force a probe to update because a dynamic object has significantly altered the environment, you can trigger a refresh via script:
public ReflectionProbe myProbe;
void UpdateEnvironment()
{
// Force the probe to re-render its cubemap
myProbe.RenderProbe();
}
By placing these probes strategically near key interactive areas or shiny surfaces, you bridge the gap between flat, dull objects and materials that feel truly integrated into the physical world of your game.
Key Takeaway: Reflection Probes capture and project a 360-degree environment map onto objects, transforming basic shaders into realistic, reflective surfaces that respond to the world around them.