VoxelGI
Real-time global illumination (GI) probe.
VoxelGI.swift:20class VoxelGI
VoxelGI
s are used to provide high-quality real-time indirect light and reflections to scenes. They precompute the effect of objects that emit light and the effect of static geometry to simulate the behavior of complex light in real-time. VoxelGI
s need to be baked before having a visible effect. However, once baked, dynamic objects will receive light from them. Furthermore, lights can be fully dynamic or baked.
Procedural generation: VoxelGI
can be baked in an exported project, which makes it suitable for procedurally generated or user-built levels as long as all the geometry is generated in advance. For games where geometry is generated at any time during gameplay, SDFGI is more suitable (see sdfgiEnabled
).
Performance: VoxelGI
is relatively demanding on the GPU and is not suited to low-end hardware such as integrated graphics (consider LightmapGI
instead). To improve performance, adjust ProjectSettings/rendering/globalIllumination/voxelGi/quality
and enable ProjectSettings/rendering/globalIllumination/gi/useHalfResolution
in the Project Settings. To provide a fallback for low-end hardware, consider adding an option to disable VoxelGI
in your project’s options menus. A VoxelGI
node can be disabled by hiding it.
Superclasses
class VisualInstance3D
Parent of all visual 3D nodes.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
Instance members
var cameraAttributes: CameraAttributes?
The
CameraAttributes
resource that specifies exposure levels to bake at. Auto-exposure and non exposure properties will be ignored. Exposure settings should be used to reduce the dynamic range present when baking. If exposure is too high, theVoxelGI
will have banding artifacts or may have over-exposure artifacts.var data: VoxelGIData?
The
VoxelGIData
resource that holds the data for thisVoxelGI
.var size: Vector3
The size of the area covered by the
VoxelGI
. If you make the size larger without increasing the subdivisions withsubdiv
, the size of each cell will increase and result in lower detailed lighting.var subdiv: VoxelGI.Subdiv
Number of times to subdivide the grid that the
VoxelGI
operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance.func bake(fromNode: Node?, createVisualDebug: Bool
) Bakes the effect from all
GeometryInstance3D
s marked withGeometryInstance3D/GIMode/`static``` and
Light3Ds marked with either
Light3D/BakeMode/bakeStaticor
Light3D/BakeMode/bakeDynamic. If `createVisualDebug` is `true`, after baking the light, this will generate a
MultiMeshthat has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the
VoxelGI``’s data and debug any issues that may be occurring.func debugBake(
) Calls
bake(fromNode:createVisualDebug:)
withcreate_visual_debug
enabled.