VoxelGIData

package
v0.0.0-...-357ca8a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

VoxelGIData contains baked voxel global illumination for use in a VoxelGI node. VoxelGIData also offers several properties to adjust the final appearance of the global illumination. These properties can be adjusted at run-time without having to bake the VoxelGI node again.

Note: To prevent text-based scene files (.tscn) from growing too much and becoming slow to load and save, always save VoxelGIData to an external binary resource file (.res) instead of embedding it within the scene. This can be done by clicking the dropdown arrow next to the VoxelGIData resource, choosing Edit, clicking the floppy disk icon at the top of the Inspector then choosing Save As....

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 Any

type Any interface {
	gd.IsClass
	AsVoxelGIData() 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]) AsObject

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

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

func (*Extension[T]) AsVoxelGIData

func (self *Extension[T]) AsVoxelGIData() 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.VoxelGIData

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

func (self Instance) Allocate(to_cell_xform Transform3D.BasisOrigin, aabb AABB.PositionSize, octree_size Vector3.XYZ, octree_cells []byte, data_cells []byte, distance_field []byte, level_counts []int32)

func (Instance) AsObject

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

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsVoxelGIData

func (self Instance) AsVoxelGIData() Instance

func (Instance) Bias

func (self Instance) Bias() Float.X

The normal bias to use for indirect lighting and reflections. Higher values reduce self-reflections visible in non-rough materials, at the cost of more visible light leaking and flatter-looking indirect lighting. To prioritize hiding self-reflections over lighting quality, set Bias to 0.0 and NormalBias to a value between 1.0 and 2.0.

func (Instance) DynamicRange

func (self Instance) DynamicRange() Float.X

The dynamic range to use (1.0 represents a low dynamic range scene brightness). Higher values can be used to provide brighter indirect lighting, at the cost of more visible color banding in dark areas (both in indirect lighting and reflections). To avoid color banding, it's recommended to use the lowest value that does not result in visible light clipping.

func (Instance) Energy

func (self Instance) Energy() Float.X

The energy of the indirect lighting and reflections produced by the VoxelGI node. Higher values result in brighter indirect lighting. If indirect lighting looks too flat, try decreasing Propagation while increasing Energy at the same time. See also UseTwoBounces which influences the indirect lighting's effective brightness.

func (Instance) GetBounds

func (self Instance) GetBounds() AABB.PositionSize

Returns the bounds of the baked voxel data as an AABB.PositionSize, which should match VoxelGI.Size after being baked (which only contains the size as a Vector3.XYZ).

Note: If the size was modified without baking the VoxelGI data, then the value of GetBounds and VoxelGI.Size will not match.

func (Instance) GetDataCells

func (self Instance) GetDataCells() []byte

func (Instance) GetLevelCounts

func (self Instance) GetLevelCounts() []int32

func (Instance) GetOctreeCells

func (self Instance) GetOctreeCells() []byte

func (Instance) GetOctreeSize

func (self Instance) GetOctreeSize() Vector3.XYZ

func (Instance) GetToCellXform

func (self Instance) GetToCellXform() Transform3D.BasisOrigin

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Interior

func (self Instance) Interior() bool

If true, Environment lighting is ignored by the VoxelGI node. If false, Environment lighting is taken into account by the VoxelGI node. Environment lighting updates in real-time, which means it can be changed without having to bake the VoxelGI node again.

func (Instance) NormalBias

func (self Instance) NormalBias() Float.X

The normal bias to use for indirect lighting and reflections. Higher values reduce self-reflections visible in non-rough materials, at the cost of more visible light leaking and flatter-looking indirect lighting. See also Bias. To prioritize hiding self-reflections over lighting quality, set Bias to 0.0 and NormalBias to a value between 1.0 and 2.0.

func (Instance) Propagation

func (self Instance) Propagation() Float.X

The multiplier to use when light bounces off a surface. Higher values result in brighter indirect lighting. If indirect lighting looks too flat, try decreasing Propagation while increasing Energy at the same time. See also UseTwoBounces which influences the indirect lighting's effective brightness.

func (Instance) SetBias

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

SetBias sets the property returned by [GetBias].

func (Instance) SetDynamicRange

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

SetDynamicRange sets the property returned by [GetDynamicRange].

func (Instance) SetEnergy

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

SetEnergy sets the property returned by [GetEnergy].

func (Instance) SetInterior

func (self Instance) SetInterior(value bool)

SetInterior sets the property returned by [IsInterior].

func (Instance) SetNormalBias

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

SetNormalBias sets the property returned by [GetNormalBias].

func (*Instance) SetObject

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

func (Instance) SetPropagation

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

SetPropagation sets the property returned by [GetPropagation].

func (Instance) SetUseTwoBounces

func (self Instance) SetUseTwoBounces(value bool)

SetUseTwoBounces sets the property returned by [IsUsingTwoBounces].

func (Instance) UseTwoBounces

func (self Instance) UseTwoBounces() bool

If true, performs two bounces of indirect lighting instead of one. This makes indirect lighting look more natural and brighter at a small performance cost. The second bounce is also visible in reflections. If the scene appears too bright after enabling UseTwoBounces, adjust Propagation and Energy.

func (Instance) Virtual

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

Jump to

Keyboard shortcuts

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