Documentation
¶
Overview ¶
Captures its surroundings as a cubemap, and stores versions of it with increasing levels of blur to simulate different material roughnesses.
The ReflectionProbe is used to create high-quality reflections at a low performance cost (when UpdateMode is UpdateOnce). ReflectionProbes can be blended together and with the rest of the scene smoothly. ReflectionProbes can also be combined with VoxelGI, SDFGI (Environment.SdfgiEnabled) and screen-space reflections (Environment.SsrEnabled) to get more accurate reflections in specific areas. ReflectionProbes render all objects within their CullMask, so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is.
Note: Unlike VoxelGI and SDFGI, ReflectionProbes only source their environment from a WorldEnvironment node. If you specify an Environment resource within a Camera3D node, it will be ignored by the ReflectionProbe. This can lead to incorrect lighting within the ReflectionProbe.
Note: When using the Mobile rendering method, only 8 reflection probes can be displayed on each mesh resource, while the Compatibility rendering method only supports up to 2 reflection probes on each mesh. Attempting to display more than 8 reflection probes on a single mesh resource using the Mobile renderer will result in reflection probes flickering in and out as the camera moves, while the Compatibility renderer will not render any additional probes if more than 2 reflection probes are being used.
Note: When using the Mobile rendering method, reflection probes will only correctly affect meshes whose visibility AABB intersects with the reflection probe's AABB. If using a shader to deform the mesh in a way that makes it go outside its AABB, GeometryInstance3D.ExtraCullMargin must be increased on the mesh. Otherwise, the reflection probe may not be visible on the mesh.
Index ¶
- type Advanced
- type AmbientMode
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AmbientColor() Color.RGBA
- func (self Instance) AmbientColorEnergy() Float.X
- func (self Instance) AmbientMode() AmbientMode
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsReflectionProbe() Instance
- func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
- func (self Instance) BlendDistance() Float.X
- func (self Instance) BoxProjection() bool
- func (self Instance) CullMask() int
- func (self Instance) EnableShadows() bool
- func (self Instance) ID() ID
- func (self Instance) Intensity() Float.X
- func (self Instance) Interior() bool
- func (self Instance) MaxDistance() Float.X
- func (self Instance) MeshLodThreshold() Float.X
- func (self Instance) OriginOffset() Vector3.XYZ
- func (self Instance) ReflectionMask() int
- func (self Instance) SetAmbientColor(value Color.RGBA)
- func (self Instance) SetAmbientColorEnergy(value Float.X)
- func (self Instance) SetAmbientMode(value AmbientMode)
- func (self Instance) SetBlendDistance(value Float.X)
- func (self Instance) SetBoxProjection(value bool)
- func (self Instance) SetCullMask(value int)
- func (self Instance) SetEnableShadows(value bool)
- func (self Instance) SetIntensity(value Float.X)
- func (self Instance) SetInterior(value bool)
- func (self Instance) SetMaxDistance(value Float.X)
- func (self Instance) SetMeshLodThreshold(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOriginOffset(value Vector3.XYZ)
- func (self Instance) SetReflectionMask(value int)
- func (self Instance) SetSize(value Vector3.XYZ)
- func (self Instance) SetUpdateMode(value UpdateMode)
- func (self Instance) Size() Vector3.XYZ
- func (self Instance) UpdateMode() UpdateMode
- func (self Instance) Virtual(name string) reflect.Value
- type UpdateMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type AmbientMode ¶
type AmbientMode int //gd:ReflectionProbe.AmbientMode
const ( // Do not apply any ambient lighting inside the [ReflectionProbe]'s box defined by its [Size]. // // [ReflectionProbe]: https://pkg.go.dev/graphics.gd/classdb/ReflectionProbe // [Size]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Size AmbientDisabled AmbientMode = 0 // Apply automatically-sourced environment lighting inside the [ReflectionProbe]'s box defined by its [Size]. // // [ReflectionProbe]: https://pkg.go.dev/graphics.gd/classdb/ReflectionProbe // [Size]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Size AmbientEnvironment AmbientMode = 1 // Apply custom ambient lighting inside the [ReflectionProbe]'s box defined by its [Size]. See [AmbientColor] and [AmbientColorEnergy]. // // [AmbientColor]: https://pkg.go.dev/graphics.gd/classdb/#Instance.AmbientColor // [AmbientColorEnergy]: https://pkg.go.dev/graphics.gd/classdb/#Instance.AmbientColorEnergy // [ReflectionProbe]: https://pkg.go.dev/graphics.gd/classdb/ReflectionProbe // [Size]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Size AmbientColor AmbientMode = 2 )
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsReflectionProbe ¶
func (*Extension[T]) AsVisualInstance3D ¶
func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.ReflectionProbe
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AmbientColor ¶
func (Instance) AmbientColorEnergy ¶
func (Instance) AmbientMode ¶
func (self Instance) AmbientMode() AmbientMode
func (Instance) AsReflectionProbe ¶
func (Instance) AsVisualInstance3D ¶
func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
func (Instance) BlendDistance ¶
func (Instance) BoxProjection ¶
func (Instance) EnableShadows ¶
func (Instance) MaxDistance ¶
func (Instance) MeshLodThreshold ¶
func (Instance) OriginOffset ¶
func (Instance) ReflectionMask ¶
func (Instance) SetAmbientColor ¶
func (Instance) SetAmbientColorEnergy ¶
func (Instance) SetAmbientMode ¶
func (self Instance) SetAmbientMode(value AmbientMode)
func (Instance) SetBlendDistance ¶
func (Instance) SetBoxProjection ¶
func (Instance) SetCullMask ¶
func (Instance) SetEnableShadows ¶
func (Instance) SetIntensity ¶
func (Instance) SetInterior ¶
func (Instance) SetMaxDistance ¶
func (Instance) SetMeshLodThreshold ¶
func (Instance) SetOriginOffset ¶
func (Instance) SetReflectionMask ¶
func (Instance) SetUpdateMode ¶
func (self Instance) SetUpdateMode(value UpdateMode)
func (Instance) UpdateMode ¶
func (self Instance) UpdateMode() UpdateMode
type UpdateMode ¶
type UpdateMode int //gd:ReflectionProbe.UpdateMode
const ( // Update the probe once on the next frame (recommended for most objects). The corresponding radiance map will be generated over the following six frames. This takes more time to update than [UpdateAlways], but it has a lower performance cost and can result in higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not when nearby geometry changes. You can force a [ReflectionProbe] update by moving the [ReflectionProbe] slightly in any direction. // // [ReflectionProbe]: https://pkg.go.dev/graphics.gd/classdb/ReflectionProbe UpdateOnce UpdateMode = 0 // Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it's recommended to only use one ReflectionProbe with [UpdateAlways] at most per scene. For all other use cases, use [UpdateOnce]. UpdateAlways UpdateMode = 1 )