ReflectionProbe

package
v0.0.0-...-fa94a0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 28 Imported by: 0

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

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 Any

type Any interface {
	gd.IsClass
	AsReflectionProbe() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsReflectionProbe

func (self *Extension[T]) AsReflectionProbe() Instance

func (*Extension[T]) AsVisualInstance3D

func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

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 New

func New() Instance

func (Instance) AmbientColor

func (self Instance) AmbientColor() Color.RGBA

func (Instance) AmbientColorEnergy

func (self Instance) AmbientColorEnergy() Float.X

func (Instance) AmbientMode

func (self Instance) AmbientMode() AmbientMode

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsReflectionProbe

func (self Instance) AsReflectionProbe() Instance

func (Instance) AsVisualInstance3D

func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance

func (Instance) BlendDistance

func (self Instance) BlendDistance() Float.X

func (Instance) BoxProjection

func (self Instance) BoxProjection() bool

func (Instance) CullMask

func (self Instance) CullMask() int

func (Instance) EnableShadows

func (self Instance) EnableShadows() bool

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Intensity

func (self Instance) Intensity() Float.X

func (Instance) Interior

func (self Instance) Interior() bool

func (Instance) MaxDistance

func (self Instance) MaxDistance() Float.X

func (Instance) MeshLodThreshold

func (self Instance) MeshLodThreshold() Float.X

func (Instance) OriginOffset

func (self Instance) OriginOffset() Vector3.XYZ

func (Instance) ReflectionMask

func (self Instance) ReflectionMask() int

func (Instance) SetAmbientColor

func (self Instance) SetAmbientColor(value Color.RGBA)

func (Instance) SetAmbientColorEnergy

func (self Instance) SetAmbientColorEnergy(value Float.X)

func (Instance) SetAmbientMode

func (self Instance) SetAmbientMode(value AmbientMode)

func (Instance) SetBlendDistance

func (self Instance) SetBlendDistance(value Float.X)

func (Instance) SetBoxProjection

func (self Instance) SetBoxProjection(value bool)

func (Instance) SetCullMask

func (self Instance) SetCullMask(value int)

func (Instance) SetEnableShadows

func (self Instance) SetEnableShadows(value bool)

func (Instance) SetIntensity

func (self Instance) SetIntensity(value Float.X)

func (Instance) SetInterior

func (self Instance) SetInterior(value bool)

func (Instance) SetMaxDistance

func (self Instance) SetMaxDistance(value Float.X)

func (Instance) SetMeshLodThreshold

func (self Instance) SetMeshLodThreshold(value Float.X)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOriginOffset

func (self Instance) SetOriginOffset(value Vector3.XYZ)

func (Instance) SetReflectionMask

func (self Instance) SetReflectionMask(value int)

func (Instance) SetSize

func (self Instance) SetSize(value Vector3.XYZ)

func (Instance) SetUpdateMode

func (self Instance) SetUpdateMode(value UpdateMode)

func (Instance) Size

func (self Instance) Size() Vector3.XYZ

func (Instance) UpdateMode

func (self Instance) UpdateMode() UpdateMode

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL