Skip to main content

Reflection probes

Out of the box every object is lit and reflects the sky of the scene (the Environment). That is wrong inside a cave, a lamp-lit room or under a bridge: a metal ball there should show the walls around it. A Reflection probe fixes this. It takes a picture of the scene from its own position, and objects inside its box use that picture for their reflections and for their ambient light, so a red room tints what stands in it.

Add one​

  1. Make an empty object where the camera of the picture should be: the middle of the room, about head height.
  2. Add component → Reflection probe.
  3. Set Size so the box (the blue outline in the scene view) covers the room.
  4. Press Play.

Objects whose position is inside the box now use the probe. Where boxes overlap, the higher Importance wins, and between equal ones the smallest box, so a small probe inside a big one gives a detail area its own picture.

SettingMeans
SizeThe box, in metres, centred on the object and along the world axes.
Box ProjectionReflections line up with the box's walls: a shiny floor shows each wall where it really stands, and things in the room sit at the right place in the reflection. Make the box match the room's walls. Off, the picture acts as if it were infinitely far away, which suits open spaces.
ImportanceWhere boxes overlap, the higher number wins (default 1).
Blend DistanceMetres: objects closer than this to the box's walls mix in the next box they are in (or the sky), turning fully into it at the wall, so walking from room to room has no sudden switch. Boxes must overlap for one to blend into the other. 0 = a hard switch at the wall. New probes start at 1.
ResolutionSize of each side of the picture (32 … 512). Sharper reflections cost memory and a little time when it is taken.
IntensityStrength of the reflections and light from the probe.
Refresh ModeOn start: the picture is taken a moment after the scene starts (and again every Refresh (s) if above 0). Every frame: taken every frame, so moving things show in reflections; it costs six extra views and a blur per frame, so use one small, low-resolution probe. Via scripting: taken when the scene starts, then only when the Refresh reflection probe action or obj.refreshProbe() asks.
Refresh (s)On start only. 0 takes the picture once. Anything above 0 takes it again that often, for rooms that change (lights switching, doors opening).
Capture layerOff leaves objects on that layer out of the picture (Unity's Culling Mask), like a camera's Draw switches. Handy for the shiny object itself, or for small moving things.

Refresh reflection probe (Graphics events) and obj.refreshProbe() in scripts take the picture again on the next frame, in any Refresh Mode.

Try it: a shiny ball in a coloured room​

  1. Make a floor and four walls, and give the walls different colours (red, green, blue, yellow).
  2. Add a Sphere in the middle. Set its material Style to Realistic, Metalness to 1 and Roughness to 0.1.
  3. Make an empty object next to the sphere (not inside it), a little above the floor, and add Reflection probe. Set Size so the blue box covers the whole room and the sphere.
  4. Press Play. The sphere now mirrors the coloured walls.

If it only shows the sky: the sphere is outside the blue box. Without a probe a metal ball reflects the scene's sky (a soft default sky when the scene has none).

Good to know​

  • The scene view shows probe reflections too: the picture is taken again a moment after you change something (without the grid, outlines and handles). In the game it follows Refresh Mode.
  • Moving objects change probe as they cross a box edge. Objects made while the game runs join the probe they are in.
  • Objects of the same look in the same room still share one material, so static batching keeps working.
  • It affects the standard shaded materials. Custom shaders, water and terrain are left alone.
  • This one probe does the job of Unity's reflection probe and of its light probes: the picture lights surfaces too, so put several small probes through a level to get local colour on characters.
  • Soft shadows and bounced light baked into the level: see Baked lighting.
  • Box Projection works on Realistic (standard) materials; Matte ones still use the probe, without it.