Course contentsShow
← Unity Game Development
Lesson 589 of 8289. Rendering and VisualsFree lesson

Creating Realistic Specular Highlights with Reflection Probes

You will set up reflection probes to capture environment cubemaps, enabling accurate metallic and glossy surface reflections on dynamic objects.

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

  1. Create the Probe: In your Hierarchy, right-click and select Light > Reflection Probe.
  2. Define the Volume: The Size and Box Projection settings are critical. The Box Projection toggle 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.
  3. Configure the Capture: Under the probe settings, set the Refresh Mode to Realtime if the environment is changing (like opening a door), or Baked if 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.