Class VoxelGIData
- Namespace
- Godot
- Assembly
- GodotSharp.dll
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....
public class VoxelGIData : Resource, IDisposable
- Inheritance
-
VoxelGIData
- Implements
- Inherited Members
Constructors
VoxelGIData()
public VoxelGIData()
Properties
Bias
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
.
public float Bias { get; set; }
Property Value
DynamicRange
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.
public float DynamicRange { get; set; }
Property Value
Energy
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.
public float Energy { get; set; }
Property Value
Interior
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.
public bool Interior { get; set; }
Property Value
NormalBias
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
.
public float NormalBias { get; set; }
Property Value
Propagation
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.
public float Propagation { get; set; }
Property Value
UseTwoBounces
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.
public bool UseTwoBounces { get; set; }
Property Value
_Data
public Dictionary _Data { get; set; }
Property Value
Methods
Allocate(Transform3D, Aabb, Vector3, byte[], byte[], byte[], int[])
public void Allocate(Transform3D toCellXform, Aabb aabb, Vector3 octreeSize, byte[] octreeCells, byte[] dataCells, byte[] distanceField, int[] levelCounts)
Parameters
toCellXform
Transform3Daabb
AabboctreeSize
Vector3octreeCells
byte[]dataCells
byte[]distanceField
byte[]levelCounts
int[]
GetBounds()
Returns the bounds of the baked voxel data as an Aabb, which should match Size after being baked (which only contains the size as a Vector3).
Note: If the size was modified without baking the VoxelGI data, then the value of GetBounds() and Size will not match.
public Aabb GetBounds()
Returns
GetDataCells()
public byte[] GetDataCells()
Returns
- byte[]
GetLevelCounts()
public int[] GetLevelCounts()
Returns
- int[]
GetOctreeCells()
public byte[] GetOctreeCells()
Returns
- byte[]
GetOctreeSize()
public Vector3 GetOctreeSize()
Returns
GetToCellXform()
public Transform3D GetToCellXform()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.