VoxelGI
Indirect-light volume using prepared VoxelGIData.
VoxelGI uses prepared static geometry for indirect lighting during rendering. Configure Size and Subdiv, prepare meshes with Static GIMode and bake Data. Size specifies full box dimensions; save external binary data as .rbin.
See VoxelGI for workflow and light-leak diagnosis. An actual GPU probe confirmed static emission and data persistence, not arbitrary dynamic-mesh quality or scene performance.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
VoxelGIConstructor
public VoxelGI();Creates a VoxelGI without Data, with Size = (20, 20, 20) and Subdiv128. Add it to the level tree, prepare geometry and bake or assign existing data. A supported Forward+ renderer is needed for visual output.
Properties4
CameraAttributesProperty
public CameraAttributes CameraAttributes { get; set; }Attributes used for bake exposure normalization, not the active camera or its Environment. Physical lighting uses CameraAttributes normalization; assignment also updates normalization for existing Data. Keep bake settings consistent with the exposure in use.
DataProperty
public VoxelGIData Data { get; set; }Prepared volume data. Without Data the VoxelGI supplies no indirect light. Assignment neither bakes nor copies the resource; null clears the assigned data. Account for resource sharing between independent volumes.
SizeProperty
public Vector3 Size { get; set; }Full box size on each axis, not half-extents. Local bounds run from −Size/2 to +Size/2. Setting clamps each component to at least 1. Rebake Data after changing it; old data is not automatically rebuilt.
SubdivProperty
public VoxelGI.SubdivEnum Subdiv { get; set; }Longest-axis detail: Subdiv64, Subdiv128, Subdiv256 or Subdiv512; defaults to Subdiv128. Shorter axes adjust accordingly. Changing this does not rebake Data; higher detail needs more work and memory. Supply a valid enum value.
Methods10
Bakevoid
public void Bake(Entity fromNode = null, bool createVisualDebug = false);Synchronously prepares visible static geometry from fromNode and descendants within the volume. With null, the root is the VoxelGI parent, which must exist. With createVisualDebug = false creates or updates Data. An assigned resource may be modified rather than replaced. Returns void: inspect errors and results; old nonnull Data alone does not prove a new bake succeeded. Saving the level does not replace saving external Data as .rbin.
| Name | Type | Default |
|---|---|---|
fromNode | Entity | null |
createVisualDebug | bool | false |
fromNodeGeometry traversal root; null uses the VoxelGI parent.
createVisualDebugtrue: create diagnostic geometry instead of ordinary Data. Defaults to false.
DebugBakevoid
public void DebugBake();Runs Bake with null and createVisualDebug = true, creating a child MultiMeshInstance3D to inspect voxelization instead of producing ordinary Data. This is an editor diagnostic method, not persistence of usable GI.
GetCameraAttributesCameraAttributes
public CameraAttributes GetCameraAttributes();Returns the current CameraAttributes. Attributes used for bake exposure normalization, not the active camera or its Environment. Physical lighting uses CameraAttributes normalization; assignment also updates normalization for existing Data. Keep bake settings consistent with the exposure in use.
CameraAttributesCurrent CameraAttributes; resources are returned by reference, not as independent copies.
GetProbeDataVoxelGIData
public VoxelGIData GetProbeData();Returns the current Data. Prepared volume data. Without Data the VoxelGI supplies no indirect light. Assignment neither bakes nor copies the resource; null clears the assigned data. Account for resource sharing between independent volumes.
VoxelGIDataCurrent Data; resources are returned by reference, not as independent copies.
GetSizeVector3
public Vector3 GetSize();Returns the current Size. Full box size on each axis, not half-extents. Local bounds run from −Size/2 to +Size/2. Setting clamps each component to at least 1. Rebake Data after changing it; old data is not automatically rebuilt.
Vector3Current Size.
GetSubdivVoxelGI.SubdivEnum
public VoxelGI.SubdivEnum GetSubdiv();Returns the current Subdiv. Longest-axis detail: Subdiv64, Subdiv128, Subdiv256 or Subdiv512; defaults to Subdiv128. Shorter axes adjust accordingly. Changing this does not rebake Data; higher detail needs more work and memory. Supply a valid enum value.
VoxelGI.SubdivEnumCurrent Subdiv.
SetCameraAttributesvoid
public void SetCameraAttributes(CameraAttributes cameraAttributes);Sets CameraAttributes. Attributes used for bake exposure normalization, not the active camera or its Environment. Physical lighting uses CameraAttributes normalization; assignment also updates normalization for existing Data. Keep bake settings consistent with the exposure in use.
| Name | Type | Default |
|---|---|---|
cameraAttributes | CameraAttributes | — |
cameraAttributesNew CameraAttributes value.
SetProbeDatavoid
public void SetProbeData(VoxelGIData data);Sets Data. Prepared volume data. Without Data the VoxelGI supplies no indirect light. Assignment neither bakes nor copies the resource; null clears the assigned data. Account for resource sharing between independent volumes.
| Name | Type | Default |
|---|---|---|
data | VoxelGIData | — |
dataNew Data value.
SetSizevoid
public void SetSize(Vector3 size);Sets Size. Full box size on each axis, not half-extents. Local bounds run from −Size/2 to +Size/2. Setting clamps each component to at least 1. Rebake Data after changing it; old data is not automatically rebuilt.
| Name | Type | Default |
|---|---|---|
size | Vector3 | — |
sizeNew Size value.
SetSubdivvoid
public void SetSubdiv(VoxelGI.SubdivEnum subdiv);Sets Subdiv. Longest-axis detail: Subdiv64, Subdiv128, Subdiv256 or Subdiv512; defaults to Subdiv128. Shorter axes adjust accordingly. Changing this does not rebake Data; higher detail needs more work and memory. Supply a valid enum value.
| Name | Type | Default |
|---|---|---|
subdiv | VoxelGI.SubdivEnum | — |
subdivNew Subdiv value.
VoxelGI.SubdivEnum
| Value | Description |
|---|---|
Max = 4 | Represents the size of the |
Subdiv128 = 1 | Use 128 subdivisions. This is the default quality setting. |
Subdiv256 = 2 | Use 256 subdivisions. |
Subdiv512 = 3 | Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end hardware, this could cause the GPU to stall. |
Subdiv64 = 0 | Use 64 subdivisions. This is the lowest quality setting, but the fastest. Use it if you can, but especially use it on lower-end hardware. |