反射探针

简介

如下所示 空间材质 ,对象可以显示反射光或漫反射光。 反射探头用作其影响区域内物体的反射光和环境光源。

这种类型的探测器捕获周围环境(作为一种360度图像),并以不断增加的* blur *水平存储它的版本。 这用于模拟材质的粗糙度以及环境照明。

While these probes are an efficient way of storing reflections, they have a few shortcomings:

  • They are efficient to render, but expensive to compute. This leads to a default behavior where they only capture on scene load.
  • 它们最适合矩形房间或地方,否则显示的反射不忠实(特别是当粗糙度为0时)。

设置

创建一个ReflectionProbe节点并将其包在您想要反射的区域周围:

../../_images/refprobe_setup.png

这应该导致立即的局部反射。 如果您使用的是Sky纹理,则默认情况下会将反射与其混合。

By default, on interiors, reflections may appear not to have much consistence. In this scenario, make sure to tick the "Box Correct" property.

../../_images/refprobe_box_property.png

此设置将反射从无限天空盒更改为反映探测器大小的框:

../../_images/refprobe_boxcorrect.png

Adjusting the box walls may help improve the reflection a bit, but it will always look best in box shaped rooms.

探头从Gizmo的中心捕获周围环境。 如果由于某种原因,房间的形状或内容遮挡了中心,可以通过移动中心的把手将其移到空的地方:

../../_images/refprobe_center_gizmo.png

默认情况下,渲染探针时仅禁用阴影贴图(仅在探针内的渲染图像中,而不是实际场景中)。 这是节省性能和内存的简单方法。 如果您想在探头中使用阴影,可以使用* Enable Shadow *设置打开/关闭它们:

../../_images/refprobe_shadows.png

最后,请记住,您可能不希望Reflection Probe渲染某些对象。 一个典型的场景是房间内的敌人会四处移动。 要防止对象在反射中渲染,请使用 Cull Mask 设置:

../../_images/refprobe_cullmask.png

内部与外部

If you are using reflection probes in an interior setting, it is recommended that the Interior property be enabled. This stops the probe from rendering the sky and also allows custom ambient lighting settings.

../../_images/refprobe_ambient.png

当探头设置为** Interior **时,可以为每个探头指定自定义恒定环境光。 只需选择颜色和能量。

Optionally, you can blend this ambient light with the probe diffuse capture by tweaking the Ambient Contribution property (0.0 means pure ambient color, while 1.0 means pure diffuse capture).

混纺

可以使用多个反射探针,Godot会使用智能算法将它们混合在一起:

../../_images/refprobe_blending.png

As you can see, this blending is never perfect (after all, these are box reflections, not real reflections), but these artifacts are only visible when using perfectly mirrored reflections. Normally, scenes have normal mapping and varying levels of roughness, which can hide this.

Alternatively, Reflection Probes work well blended together with Screen Space Reflections to solve these problems. Combining them makes local reflections appear more faithful, while probes are only used as a fallback when no screen-space information is found:

../../_images/refprobe_ssr.png

最后,在制作内部和外部结合的水平时,建议混合使用内部和外部探头。 在门附近,探头可以标记为 外部 (因此它将获得天空反射),而在内部,它可以是内部。

反思地图集

在当前的渲染器实现中,所有探测器都具有相同的大小并且适合反射图集。 可以在项目设置 ->质量 ->反射中自定义探针的大小和数量

The default setting of Atlas Subdiv: 8 will allow up to 16 reflection probes in a scene. This value needs to be increased if you need more reflection probes.

../../_images/refprobe_atlas.png