Version: Unity 6 Beta (6000.0)
Language : English
Types of Reflection Probe
Advanced Reflection Probe Features

Using Reflection Probes

Default Reflection Probes

When you add a new sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
, Unity automatically creates a hidden default Reflection Probe that stores Unity’s built-in Default SkyboxA special type of Material used to represent skies. Usually six-sided. More info
See in Glossary
cubemapA collection of six square textures that can represent the reflections in an environment or the skybox drawn behind your geometry. The six squares form the faces of an imaginary cube that surrounds an object; each face represents the view along the directions of the world axes (up, down, left, right, forward and back). More info
See in Glossary
.

The data in the hidden Reflection Probe is fixed. For example, if you change the Skybox Material in the Lighting window, the data in the probes doesn’t change, so environment lighting on objects stays the same.

To stop using the hidden Reflection Probe, select Generate Lighting or Clear Baked Data in the Lighting window. Unity then creates and uses a new default baked Reflection Probe (the ambient Reflection Probe). This Reflection Probe is an asset in the Project windowA window that shows the contents of your Assets folder (Project tab) More info
See in Glossary
, and updates when you select Generate Lighting.

Adding Reflection Probes

You can add the Reflection Probe component to any object in a Scene but it’s standard to add each probe to a separate empty GameObject. The usual workflow is:

  • Create a new empty GameObject (menu: GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
    See in Glossary
    > Create Empty) and then add the Reflection Probe component to it (menu: ComponentA functional part of a GameObject. A GameObject can contain any number of components. Unity has many built-in components, and you can create your own by writing scripts that inherit from MonoBehaviour. More info
    See in Glossary
    > Rendering > Reflection ProbeA rendering component that captures a spherical view of its surroundings in all directions, rather like a camera. The captured image is then stored as a Cubemap that can be used by objects with reflective materials. More info
    See in Glossary
    ). Alternatively, if you already have a probe in the scene you will probably find it easier to duplicate that instead (menu: Edit > Duplicate).
  • Place the new probe in the desired location and set its Offset point and the size of its zone of effect.
  • Optionally set other properties on the probe to customise its behaviour.
  • Continue adding probes until all required locations have been assigned.

To see the reflections, you will also need at least one reflective object in the scene. A simple test object can be created as follows:

  • Add a primitive object such as a Sphere to the scene (menu: GameObject > 3D ObjectA 3D GameObject such as a cube, terrain or ragdoll. More info
    See in Glossary
    > Sphere).
  • Create a new material (menu: AssetsAny media or data that can be used in your game or project. An asset may come from a file created outside of Unity, such as a 3D Model, an audio file or an image. You can also create some asset types in Unity, such as an Animator Controller, an Audio Mixer or a Render Texture. More info
    See in Glossary
    > Create > MaterialAn asset that defines how a surface should be rendered. More info
    See in Glossary
    ) and leave the default Standard shader in place.
  • Make the material reflective by setting both the Metallic and Smoothness properties to 1.0.
  • Drag the newly-created material onto the sphere object to assign it.

The sphere can now show the reflections obtained from the probes. A simple arrangement with a single probe is enough to see the basic effect of the reflections.

Finally, the probes must be baked before the reflections will become visible. Press the Bake button in the Reflection Probe inspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary
to update the probes.

Positioning probes

The position of a probe is primarily determined by the position of its GameObject and so you can simply drag the object to the desired location. Having done this, you should set the probe’s zone of effect; this is an axis-aligned box shape whose dimensions are set by the Box Size property. You can set the size values directly or enable the size editing mode in the inspector and drag the sides of the box in the Scene viewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary
(see the Reflection Probe component page for details). The zones of the full set of probes should collectively cover all areas of the scene where a reflective object might pass.

You should place probes close to any large objects in the scene that would be reflected noticeably. Areas around the centres and corners of walls are good candidate locations for probes. Smaller objects might require probes close by if they have a strong visual effect. For example, you would probably want the flames of a campfire to be reflected even if the object itself is small and otherwise insignificant.

When you have probes in all the appropriate places, you then need to define the zone of effect for each probe, which you can do using the Box Size property as mentioned above. A wall might need just a single probe zone along most of its length (at least if it has a fairly uniform appearance) but the zone might be relatively narrow in the direction perpendicular to the wall; this would imply that the wall is only reflected by objects that are fairly close to it. An open space whose appearance varies little from place to place can often be covered by a single probe. Note that a probe’s zone is aligned to the main world axes (X, Y and Z) and can’t be rotated. This means that sometimes a group of probes might be needed along a uniform wall if it is not axis-aligned.

By default, a probe’s zone of effect is centred on its view point but this may not be the ideal position for capturing the reflection cubemap. For example, the probe zone for a very high wall might extend some distance from the wall but you might want the reflection to be captured from a point close to it rather than the zone’s centre. You can optionally add an offset to view point using the Box Offset property (ie, the offset is the position in the GameObject’s local space that the probe’s cubemap view is generated from). Using this, you can easily place the view point anywhere within the zone of effect or indeed outside the zone altogether.

Overlapping probe zones

It would be very difficult to position the zones of neighbouring reflection probes without them overlapping and fortunately, it is not necessary to do so. However, this leaves the issue of choosing which probe to use in the overlap areas. By default, Unity calculates the intersection between the reflective object’s bounding box and each of the overlapping probe zones; the zone which has the largest volume of intersection with the bounding box is the one that will be selected.

Probe A is selected since its intersection with the object is larger
Probe A is selected since its intersection with the object is larger

You can modify the calculation using the probes’ Importance properties. Probes with a higher importance value have priority over those of lower importance within overlap zones. This is useful, say, if you have a small probe zone that is contained completely inside a larger zone (ie, the intersection of the character’s bounding box with the enclosing zone might always be larger and so the small zone would never be used).

Blending

To enable Reflection Probe blending navigate to Graphic Settings > Tier settings. Tier settings are only available in Unity’s Built-in Render Pipeline. When blending is enabled, Unity gradually fades out one probe’s cubemap while fading in the other’s as the reflective object passes from one zone to the other. This gradual transition avoids the situation where a distinctive object suddenly “pops” into the reflection as an object crosses the zone boundary.

Blending is controlled using the Reflection Probes property of the Mesh RendererA mesh component that takes the geometry from the Mesh Filter and renders it at the position defined by the object’s Transform component. More info
See in Glossary
component. Four blending options are available:

  • Off - Reflection probe blending is disabled. Only the skybox will be used for reflection
  • Blend Probes - Blends only adjacent probes and ignores the skybox. You should use this for objects that are “indoors” or in covered parts of the scene (eg, caves and tunnels) since the sky is not visible from these place and so should never appear in the reflections.
  • Blend Probes and Skybox - Works like Blend Probes but also allows the skybox to be used in the blending. You should use this option for objects in the open air, where the sky would always be visible.
  • Simple - Disables blending between probes when there are two overlapping reflection probe volumes.

When probes have equal Importance values, the blending weight for a given probe zone is calculated by dividing its intersection (volume) with the object’s bounding box by the sum of all probes’ intersections with the box. For example, if the box intersects probe A’s zone by 1.0 cubic units and intersects probe B’s zone by 2.0 cubic units then the blending values will be:

  • Probe A: 1.0 / (1.0 + 2.0) = 0.33
  • Probe B: 2.0 / (1.0 + 2.0) = 0.67

In other words, the blend will incorporate 33% of probe A’s reflection and 67% of probe B’s reflection.

The calculation must be handled slightly differently in the case where one probe is entirely contained within the other, since the inner zone overlaps entirely with the outer. If the object’s bounding box is entirely within the inner zone then that zone’s blending weight is 1.0 (ie, the outer zone is not used at all). When the object is partially outside the inner zone, the intersection volume of its bounding box with the inner zone is divided by the total volume of the box. For example, if the intersection volume is 1.0 cubic units and the bounding box’s volume is 4.0 cubic units, then the blending weight of the inner probe will be 1.0 / 4.0 = 0.25. This value is then subtracted from 1.0 to get the weight for the outer probe which in this case will be 0.75.

When one probe involved in the blend has a higher Importance value than another, the more important probe overrides the other in the usual way.


  • Updated in 5.6

  • 2017–06–06 Page published

Types of Reflection Probe
Advanced Reflection Probe Features
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961