Version: 5.3
반사 프로브의 타입
고급 반사 프로브 기능

반사 프로브 사용

The Reflection Probe component can be added to any object in the scene but you will typically want to add each probe to a separate empty GameObject. The usual workflow is:

  • Create a new empty GameObject (menu: GameObject > Create Empty) and then add the Reflection Probe component to it (menu: Component > Rendering > Reflection Probe). 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 Origin point and the size of its zone of effect.
  • 필요하다면 프로브에 다른 프로퍼티를 설정하여 동작을 커스터마이즈합니다.
  • 필요한 위치가 모두 할당될 때까지 프로브를 계속 추가합니다.

반사를 보려면 씬에 반사 오브젝트가 하나 이상 있어야 합니다. 간단한 테스트 오브젝트를 다음과 같이 생성할 수 있습니다.

  • Add a primitive object such as a Sphere to the scene (menu: GameObject > 3D Object > Sphere).
  • Create a new material (menu: Assets > Create > Material) and leave the default Standard shader in place.
  • Make the material reflective by setting both the Metallic and Smoothness properties to 1.0.
  • 새로 만든 머티리얼을 구체 오브젝트로 드래그하여 할당합니다.

이제 구체에는 프로브로부터 얻은 반사 효과가 표시됩니다. 프로브가 1개 있는 간단한 구성으로 반사의 기본적인 효과를 충분히 나타낼 수 있습니다.

Finally, the probes must be baked before the reflections become visible. If you have the Auto option enabled in the Lighting window (this is the default setting) then the reflections will update as you position or change objects in the scene, although the response is not instantaneous. If you disable auto baking then you must click the Bake button in the Reflection Probe inspector to update the probes. The main reason for disabling auto baking is that the baking process can take quite some time for a complicated scene with many probes.

프로브(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 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 view (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.

씬에서 눈에 띄게 반사되는 큰 오브젝트 가까이에 프로브를 배치해야 합니다. 벽 중앙 및 모서리의 주변 영역은 프로브를 배치하는 데 적합합니다. 더 작은 오브젝트의 시각 효과가 강한 경우 프로브를 오브젝트 가까이에 배치해야 할 수 있습니다. 예를 들어 모닥불의 불꽃은 오브젝트 자체가 작고 달리 중요하지 않아도 반사되도록 하는 것이 좋습니다.

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 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 Probe Origin property (ie, the origin 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.

프로브 영역(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.

A 프로브가 오브젝트와 교차하는 용적이 더 크기 때문에 선택되었습니다.
A 프로브가 오브젝트와 교차하는 용적이 더 크기 때문에 선택되었습니다.

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).

블렌딩

If your target platform uses Shader Model 3 or better then you have the option of blending between probes in the areas where their zones overlap. With blending enabled, Unity will gradually fade 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 Renderer component. Two blending options are available:

  • 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.

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:

  • A 프로브: 1.0 / (1.0 + 2.0) = 0.33
  • B 프로브: 2.0 / (1.0 + 2.0) = 0.67

다시 말해, 블렌드는 A 프로브의 반사를 33% 포함하고 프로브 B의 반사를 67% 포함합니다.

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.

반사 프로브의 타입
고급 반사 프로브 기능