reckfellENGINE

VoxelGIData

Baked data and parameters for a VoxelGI volume.

On this page
class VoxelGIDataReckfellSharpInherits Resource

VoxelGIData stores a prepared octree and indirect-light parameters. The normal workflow is VoxelGI.Bake → Data → external .rbin saving. Make an independent resource copy to apply different settings to one bake; changing shared Data affects volumes using it.

The example returns a resource owned by the caller. Assigning volume.Data makes the volume retain the copy; release your own reference when no longer needed. This copies already baked data rather than rebaking geometry.

C#
using System;
using Reckfell;

public static class VoxelDataCopies
{
    // Caller owns the returned resource. The source stays unchanged.
    public static VoxelGIData WithEnergy(VoxelGIData source, float energy)
    {
        ArgumentNullException.ThrowIfNull(source);
        if (!float.IsFinite(energy) || energy < 0f)
            throw new ArgumentOutOfRangeException(nameof(energy));
        var copy = (VoxelGIData)source.Duplicate(true);
        copy.Energy = energy;
        return copy;
    }
}

See the VoxelGI guide for workflow and diagnosis.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

VoxelGIDataConstructor
# VoxelGIData
C#
public VoxelGIData();

Creates a resource without baked geometry. Normally use VoxelGI.Bake and VoxelGI.Data, or load an existing .rbin. A resource existing does not itself mean usable GI-volume data exists.

Properties8

BiasProperty
# Bias
C#
public float Bias { get; set; }

Initial cone-trace distance in voxel coordinates, distinct from NormalBias. Helps reduce self-occlusion, but excessive values can skip thin occluders. A new resource getter returns 1.5; this alone does not prove pixel equivalence of every renderer default. The inspector hint 0…8 does not clamp the setter.

DynamicRangeProperty
# DynamicRange
C#
public float DynamicRange { get; set; }

VoxelGI buffer energy encoding range, default 2. Used to scale energy down and restore it during calculations; use a finite positive value. The inspector hint 1…8 does not clamp the setter. This is not camera exposure or a quality setting without precision tradeoffs.

EnergyProperty
# Energy
C#
public float Energy { get; set; }

Indirect-light multiplier, default 1. Setting 0 removes the tested VoxelGI contribution without disabling direct light or emissive-material visibility. The inspector hint 0…64 does not clamp the setter: 65 is retained, for example. Use a finite nonnegative value.

InteriorProperty
# Interior
C#
public bool Interior { get; set; }

When true excludes sky contribution from VoxelGI; defaults to false. Useful for closed rooms, but does not disable direct lights or repair geometry holes. Changing it does not rebuild static meshes.

NormalBiasProperty
# NormalBias
C#
public float NormalBias { get; set; }

Offsets the sampling position along its normal in voxel coordinates, default 0. Unlike Bias it moves the sample origin rather than only changing initial distance along the cone. Adjust gradually while checking light leaks. The inspector hint 0…8 does not clamp the setter.

PropagationProperty
# Propagation
C#
public float Propagation { get; set; }

Energy propagation coefficient used while building VoxelGI levels, default 0.5. The inspector hint 0…1 does not clamp the setter; stay within the normal range unless you have verified another regime. Higher values do not guarantee physically correct brightness; compare with Energy and UseTwoBounces.

UseTwoBouncesProperty
# UseTwoBounces
C#
public bool UseTwoBounces { get; set; }

Enables a second indirect-light bounce pass; defaults to true. May change brightness and light distribution. Does not promise free quality improvement: check the image and GPU time on the target scene. Does not rebake geometry.

_DataProperty
# _Data
C#
public Reckfell.Collections.Dictionary _Data { get; set; }

Internal serialization dictionary, not a stable external format. Contains bounds, octree_size, octree_cells, octree_data, level_counts, to_cell_xform and either raw octree_df or compressed L8 PNG octree_df_png. Do not confuse PNG with Allocate raw bytes. Reading constructs a serialization representation; writing requires a complete consistent dataset and calls Allocate. Energy/Bias and other properties are stored separately. Use Duplicate(true) for ordinary copies and ResourceSaver with .rbin for files.

Methods22

Allocate2 overloads
# Allocate · 1/2
C#
public void Allocate(Transform3D toCellXform, Aabb aabb, Vector3 octreeSize, byte[] octreeCells, byte[] dataCells, byte[] distanceField, int[] levelCounts);

Low-level upload of a consistent set of already prepared voxel buffers. Does not voxelize a mesh or replace Bake. octreeCells/dataCells use 32/16 bytes per cell; distanceField takes raw L8 bytes. Use Duplicate(true) for ordinary copying.

Old GPU buffers are freed before some input checks: this operation is not atomic and does not guarantee previous state survives an error. Returns void; do not use with untrusted or arbitrarily constructed arrays. Supply consistent data and inspect errors. Input C# arrays do not remain a live view of GPU data.

Parameters
NameTypeDefault
toCellXformTransform3D—
aabbAabb—
octreeSizeVector3—
octreeCellsbyte[]—
dataCellsbyte[]—
distanceFieldbyte[]—
levelCountsint[]—
toCellXform

Local-volume-to-cell transform from the same dataset.

aabb

Local volume bounds from the same bake.

octreeSize

Grid dimensions along each axis; use positive integral dimensions from a valid bake.

octreeCells

Internal structure: length must be a multiple of 32 bytes. Length alone does not establish validity.

dataCells

Data for the same cells: 16 bytes per cell, half the octreeCells length.

distanceField

Raw L8 3D distance-field data matching those dimensions; not the PNG bytes in _Data.

levelCounts

Cell count at each level of the same octree.

# Allocate · 2/2
C#
public void Allocate(Transform3D toCellXform, Aabb aabb, Vector3 octreeSize, ReadOnlySpan<byte> octreeCells, ReadOnlySpan<byte> dataCells, ReadOnlySpan<byte> distanceField, ReadOnlySpan<int> levelCounts);

Low-level upload of a consistent set of already prepared voxel buffers. Does not voxelize a mesh or replace Bake. octreeCells/dataCells use 32/16 bytes per cell; distanceField takes raw L8 bytes. Use Duplicate(true) for ordinary copying.

Old GPU buffers are freed before some input checks: this operation is not atomic and does not guarantee previous state survives an error. Returns void; do not use with untrusted or arbitrarily constructed arrays. Supply consistent data and inspect errors. The span overload does not retain references to managed input memory after the call.

Parameters
NameTypeDefault
toCellXformTransform3D—
aabbAabb—
octreeSizeVector3—
octreeCellsReadOnlySpan<byte>—
dataCellsReadOnlySpan<byte>—
distanceFieldReadOnlySpan<byte>—
levelCountsReadOnlySpan<int>—
toCellXform

Local-volume-to-cell transform from the same dataset.

aabb

Local volume bounds from the same bake.

octreeSize

Grid dimensions along each axis; use positive integral dimensions from a valid bake.

octreeCells

Internal structure: length must be a multiple of 32 bytes. Length alone does not establish validity.

dataCells

Data for the same cells: 16 bytes per cell, half the octreeCells length.

distanceField

Raw L8 3D distance-field data matching those dimensions; not the PNG bytes in _Data.

levelCounts

Cell count at each level of the same octree.

GetBiasfloat
# GetBias
C#
public float GetBias();

Returns Bias. Initial cone-trace distance in voxel coordinates, distinct from NormalBias. Helps reduce self-occlusion, but excessive values can skip thin occluders. A new resource getter returns 1.5; this alone does not prove pixel equivalence of every renderer default. The inspector hint 0…8 does not clamp the setter.

Returns float

Current Bias value.

GetBoundsAabb
# GetBounds
C#
public Aabb GetBounds();

Returns local bounds stored by Bake or Allocate, not automatically transformed world-space Entity bounds.

Returns Aabb

Stored local Aabb.

GetDataCellsbyte[]
# GetDataCells
C#
public byte[] GetDataCells();

Returns byte[] internal cell data, 16 bytes per cell in a valid bake. This is not a Color array or an artist-editable texture. Editing the returned C# array does not change the resource.

Returns byte[]

Copy of internal cell data.

GetDynamicRangefloat
# GetDynamicRange
C#
public float GetDynamicRange();

Returns DynamicRange. VoxelGI buffer energy encoding range, default 2. Used to scale energy down and restore it during calculations; use a finite positive value. The inspector hint 1…8 does not clamp the setter. This is not camera exposure or a quality setting without precision tradeoffs.

Returns float

Current DynamicRange value.

GetEnergyfloat
# GetEnergy
C#
public float GetEnergy();

Returns Energy. Indirect-light multiplier, default 1. Setting 0 removes the tested VoxelGI contribution without disabling direct light or emissive-material visibility. The inspector hint 0…64 does not clamp the setter: 65 is retained, for example. Use a finite nonnegative value.

Returns float

Current Energy value.

GetLevelCountsint[]
# GetLevelCounts
C#
public int[] GetLevelCounts();

Returns int[] cell counts for each octree level. In the checked valid bake the sum equals GetOctreeCells().Length / 32. Editing the C# array does not change the resource.

Returns int[]

Copy of cell counts per level.

GetNormalBiasfloat
# GetNormalBias
C#
public float GetNormalBias();

Returns NormalBias. Offsets the sampling position along its normal in voxel coordinates, default 0. Unlike Bias it moves the sample origin rather than only changing initial distance along the cone. Adjust gradually while checking light leaks. The inspector hint 0…8 does not clamp the setter.

Returns float

Current NormalBias value.

GetOctreeCellsbyte[]
# GetOctreeCells
C#
public byte[] GetOctreeCells();

Returns a byte[] containing the internal octree structure. A valid bake uses 32 bytes per cell. The returned C# array is independent: editing it does not modify GPU data. Reading may require renderer data retrieval; avoid unnecessary per-frame calls.

Returns byte[]

Copy of internal octree cells.

GetOctreeSizeVector3
# GetOctreeSize
C#
public Vector3 GetOctreeSize();

Returns stored cell counts along three axes as Vector3. These are discrete grid dimensions, not meters or VoxelGI Size.

Returns Vector3

Grid dimensions per axis.

GetPropagationfloat
# GetPropagation
C#
public float GetPropagation();

Returns Propagation. Energy propagation coefficient used while building VoxelGI levels, default 0.5. The inspector hint 0…1 does not clamp the setter; stay within the normal range unless you have verified another regime. Higher values do not guarantee physically correct brightness; compare with Energy and UseTwoBounces.

Returns float

Current Propagation value.

GetToCellXformTransform3D
# GetToCellXform
C#
public Transform3D GetToCellXform();

Returns the stored transform from local volume coordinates to cell coordinates, not the VoxelGI GlobalTransform.

Returns Transform3D

Stored transform to cell coordinates.

IsInteriorbool
# IsInterior
C#
public bool IsInterior();

Returns Interior. When true excludes sky contribution from VoxelGI; defaults to false. Useful for closed rooms, but does not disable direct lights or repair geometry holes. Changing it does not rebuild static meshes.

Returns bool

Current Interior value.

IsUsingTwoBouncesbool
# IsUsingTwoBounces
C#
public bool IsUsingTwoBounces();

Returns UseTwoBounces. Enables a second indirect-light bounce pass; defaults to true. May change brightness and light distribution. Does not promise free quality improvement: check the image and GPU time on the target scene. Does not rebake geometry.

Returns bool

Current UseTwoBounces value.

SetBiasvoid
# SetBias
C#
public void SetBias(float bias);

Sets Bias. Initial cone-trace distance in voxel coordinates, distinct from NormalBias. Helps reduce self-occlusion, but excessive values can skip thin occluders. A new resource getter returns 1.5; this alone does not prove pixel equivalence of every renderer default. The inspector hint 0…8 does not clamp the setter.

Parameters
NameTypeDefault
biasfloat—
bias

New Bias value; follow the property usage limits.

SetDynamicRangevoid
# SetDynamicRange
C#
public void SetDynamicRange(float dynamicRange);

Sets DynamicRange. VoxelGI buffer energy encoding range, default 2. Used to scale energy down and restore it during calculations; use a finite positive value. The inspector hint 1…8 does not clamp the setter. This is not camera exposure or a quality setting without precision tradeoffs.

Parameters
NameTypeDefault
dynamicRangefloat—
dynamicRange

New DynamicRange value; follow the property usage limits.

SetEnergyvoid
# SetEnergy
C#
public void SetEnergy(float energy);

Sets Energy. Indirect-light multiplier, default 1. Setting 0 removes the tested VoxelGI contribution without disabling direct light or emissive-material visibility. The inspector hint 0…64 does not clamp the setter: 65 is retained, for example. Use a finite nonnegative value.

Parameters
NameTypeDefault
energyfloat—
energy

New Energy value; follow the property usage limits.

SetInteriorvoid
# SetInterior
C#
public void SetInterior(bool interior);

Sets Interior. When true excludes sky contribution from VoxelGI; defaults to false. Useful for closed rooms, but does not disable direct lights or repair geometry holes. Changing it does not rebuild static meshes.

Parameters
NameTypeDefault
interiorbool—
interior

New Interior value; follow the property usage limits.

SetNormalBiasvoid
# SetNormalBias
C#
public void SetNormalBias(float bias);

Sets NormalBias. Offsets the sampling position along its normal in voxel coordinates, default 0. Unlike Bias it moves the sample origin rather than only changing initial distance along the cone. Adjust gradually while checking light leaks. The inspector hint 0…8 does not clamp the setter.

Parameters
NameTypeDefault
biasfloat—
bias

New NormalBias value; follow the property usage limits.

SetPropagationvoid
# SetPropagation
C#
public void SetPropagation(float propagation);

Sets Propagation. Energy propagation coefficient used while building VoxelGI levels, default 0.5. The inspector hint 0…1 does not clamp the setter; stay within the normal range unless you have verified another regime. Higher values do not guarantee physically correct brightness; compare with Energy and UseTwoBounces.

Parameters
NameTypeDefault
propagationfloat—
propagation

New Propagation value; follow the property usage limits.

SetUseTwoBouncesvoid
# SetUseTwoBounces
C#
public void SetUseTwoBounces(bool enable);

Sets UseTwoBounces. Enables a second indirect-light bounce pass; defaults to true. May change brightness and light distribution. Does not promise free quality improvement: check the image and GPU time on the target scene. Does not rebake geometry.

Parameters
NameTypeDefault
enablebool—
enable

New UseTwoBounces value; follow the property usage limits.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.