Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Sonde di riflessi

As stated in the Standard Material 3D and ORM Material 3D, objects can show reflected and/or diffuse light. Reflection probes are used as a source of reflected and ambient light for objects inside their area of influence. They can be used to provide more accurate reflections than VoxelGI and SDFGI while being fairly cheap on system resources.

Since reflection probes can also store ambient light, they can be used as a low-end alternative to VoxelGI and SDFGI when baked lightmaps aren't viable (e.g. in procedurally generated levels).

Reflection probes can also be used at the same time as screen-space reflections to provide reflections for off-screen objects. In this case, Godot will blend together the screen-space reflections and reflections from reflection probes.

Vedi anche

Not sure if ReflectionProbe is suited to your needs? See Quale tecnica di illuminazione globale dovrei utilizzare? for a comparison of GI techniques available in Godot 4.

Confronto visivo

Reflection probe disabled. Environment sky is used as a fallback.

Reflection probe disabled. Environment sky is used as a fallback.

Sonda di riflessione abilitata.

Sonda di riflessione abilitata.

Sonda di riflessione abilitata.

Reflection probe enabled with LightmapGI used at the same time. The lightmap appears in the reflection.

By combining reflection probes with screen-space reflections, you can get the best of both worlds: high-quality reflections for general room structure (that remain present when off-screen), while also having real-time reflections for small details.

Reflections in a room using ReflectionProbe only.

Reflections in a room using ReflectionProbe only. Notice how small details don't have any reflections.

Reflections in a room using screen-space reflections only.

Reflections in a room using screen-space reflections only. Notice how the reflection on the sides of the room's walls is partly missing due to being off-screen.

Reflections in a room using ReflectionProbe and screen-space reflections together.

Reflections in a room using ReflectionProbe and screen-space reflections together. The screen-space reflections are blended with the reflection probe, acting as a fallback in situations where the reflection probe fails to display any reflection.

Configurazione di un ReflectionProbe

  • Aggiungi un nodo ReflectionProbe.

  • Configure the ReflectionProbe's extents in the inspector to fit your scene. To get reasonably accurate reflections, you should generally have one ReflectionProbe node per room (sometimes more for large rooms).

Suggerimento

Remember that ReflectionProbe extents don't have to be square, and you can even rotate the ReflectionProbe node to fit rooms that aren't aligned with the X/Z grid. Use this to your advantage to better cover rooms without having to place too many ReflectionProbe nodes.

Proprietà di ReflectionProbe

  • Update Mode: Controls when the reflection probe updates. Once only renders the scene once every time the ReflectionProbe is moved. This makes it much faster to render compared to the Always update mode, which forces the probe to re-render everything around it every frame. Leave this property on Once (default) unless you need the reflection probe to update every frame.

  • Intensity: The brightness of the reflections and ambient lighting. This usually doesn't need to be changed from its default value of 1.0, but you can decrease it 1.0 if you find that reflections look too strong.

  • Max Distance: controlla la distanza massima usata dalla telecamera interna del ReflectionProbe. La distanza è sempre almeno uguale a Extents, ma può essere aumentata per rendere visibili nei riflessi gli oggetti situati fuori dalle estensioni. Questa proprietà non influisce sulla distanza massima alla quale il ReflectionProbe stesso è visibile.

  • Extents: The area that will be affected by the ReflectionProbe's lighting and reflections.

  • Origin Offset: The origin to use for the internal camera used for reflection probe rendering. This must always be constrained within the Extents. If needed, adjust this to prevent the reflection from being obstructed by a solid object located exactly at the center of the ReflectionProbe.

  • Box Projection: Controls whether parallax correction should be used when rendering the reflection probe. This adjusts the reflection's appearance depending on the camera's position (relative to the reflection probe). This has a small performance cost, but the quality increase is often worth it in box-shaped rooms. Note that this effect doesn't work quite as well in rooms with less regular shapes (such as ellipse-shaped rooms).

  • Interior: If enabled, ambient lighting will not be sourced from the environment sky, and the background sky won't be rendered onto the reflection probe.

  • Enable Shadows: Controls whether real-time light shadows should be rendered within the reflection probe. Enable this to improve reflection quality at the cost of performance. This should be left disabled for reflection probes with the Always mode, as it's very expensive to render reflections with shadows every frame. Fully baked light shadows are not affected by this setting and will be rendered in the reflection probe regardless.

  • Cull Mask: Controls which objects are visible in the reflection. This can be used to improve performance by excluding small objects from the reflection. This can also be used to prevent an object from having self-reflection artifacts in situations where Origin Offset can't be used.

  • Mesh LOD Threshold: The automatic level of detail threshold to use for rendering meshes within the reflection. This only affects meshes that have automatic LODs generated for them. Higher values can improve performance by using less detailed geometry, especially for objects that are far away from the reflection's origin. The visual difference of using less detailed objects is usually not very noticeable during gameplay, especially in rough reflections.

The Ambient category features several properties to adjust ambient lighting rendered by the ReflectionProbe:

  • Mode: If set to Disabled, no ambient light is added by the probe. If set to Environment, the ambient light color is automatically sampled from the environment sky (if Interior is disabled) and the reflection's average color. If set to Constant Color, the color specified in the Color property is used instead. The Constant Color mode can be used as an approximation of area lighting.

  • Color: The color to use when the ambient light mode is set to Constant Mode.

  • Color Energy: The multiplier to use for the ambient light custom Color. This only has an effect when the ambient light mode is Custom Color.

Fusioni tra ReflectionProbe

Per rendere più fluide le transizioni tra le sorgenti di riflessione, Godot supporta la fusione automatica delle sonde:

  • Fino a 4 ReflectionProbe si possono fondere in una determinata posizione. Un ReflectionProbe si dissolverà gradualmente fino a tornare all'illuminazione ambientale quando non tocca nessun altro nodo ReflectionProbe.

  • SDFGI e VoxelGI si fondono perfettamente con i ReflectionProbe, se utilizzati. Ciò consente di posizionare i ReflectionProbe strategicamente per ottenere riflessi più accurati (o completamente in tempo reale) dove necessario, pur avendo a disposizione riflessi approssimativi nell'area di influenza di un VoxelGI o un SDFGI.

Per far sì che più ReflectionProbe si fondano tra loro, è necessario che una parte di ciascun ReflectionProbe si sovrapponga all'area dell'altra. Le estensioni dovrebbero sovrapporsi il meno possibile con altri ReflectionProbe per migliorare le prestazioni di rendering (tipicamente di poche unità nello spazio 3D).

Limitazioni

Quando si utilizza il renderer Forward+, Godot utilizza un approccio di clustering per renderizzare le sonde di riflessione. È possibile aggiungere tutte le sonde di riflessione desiderate (purché le prestazioni lo permettano). Tuttavia, esiste un limite predefinito di 512 elementi clusterizzati che possono essere presenti nella vista della telecamera attuale. Un elemento clusterizzato è una luce omnidirezionale, un riflettore, una decalcomania o una sonda di riflessione. È possibile aumentare questo limite regolando Elementi clusterizzati massimi nelle Impostazioni del progetto > Rendering > Limiti > Costruttore cluster.

When using the Mobile renderer, only 8 reflection probes can be applied on each individual Mesh resource. If there are more reflection probes affecting a single mesh, not all of them will be rendered on the mesh.

Similarly, when using the Compatibility renderer, up to 2 reflection probes can be applied per mesh. If more than 2 reflection probes affect a single mesh, additional probes will not be rendered.