VoxelFormat¶
Inherits: Resource
Specifies the format of voxels.
Description:¶
Specifies the format of voxels. Currently, it only stores how many bytes each channel uses per voxel.
Voxels have a default format which is often enough for most use cases, but sometimes it is necessary to change it. In this case, you may create a new VoxelFormat resource, do the changes, and assign it to a VoxelNode.
WARNING: it is recommended to choose a format early in development (whether it is the default, or a custom one). If you want to change much later and you have saves in the wild, you will have to figure out how to convert them, otherwise loading them will be problematic.
Properties:¶
| Type | Name | Default |
|---|---|---|
| Array | _data | [0, 1, 1, 0, 1, 1, 0, 0, 0] |
| Depth | color_depth | DEPTH_8_BIT (0) |
| Depth | indices_depth | DEPTH_16_BIT (1) |
| Depth | sdf_depth | DEPTH_16_BIT (1) |
| Depth | type_depth | DEPTH_16_BIT (1) |
Methods:¶
| Return | Signature |
|---|---|
| void | configure_buffer ( VoxelBuffer buffer ) const |
| VoxelBuffer | create_buffer ( Vector3i size ) const |
| Depth | get_channel_depth ( ChannelId channel_index ) const |
| void | set_channel_depth ( ChannelId channel_index, Depth depth ) |
Property Descriptions¶
Array _data = [0, 1, 1, 0, 1, 1, 0, 0, 0]¶
(This property has no documentation)
Depth color_depth = DEPTH_8_BIT (0)¶
Depth of VoxelBuffer.CHANNEL_COLOR.
Depth indices_depth = DEPTH_16_BIT (1)¶
Depth of VoxelBuffer.CHANNEL_INDICES. Only 8-bit and 16-bit depths are supported.
Depth sdf_depth = DEPTH_16_BIT (1)¶
Depth of VoxelBuffer.CHANNEL_SDF.
Depth type_depth = DEPTH_16_BIT (1)¶
Depth of VoxelBuffer.CHANNEL_TYPE. Only 8-bit and 16-bit depths are supported.
Method Descriptions¶
void configure_buffer( VoxelBuffer buffer )¶
Clears and formats the VoxelBuffer using properties from the current format. Should be used on a buffer that hasn't been modified yet.
VoxelBuffer create_buffer( Vector3i size )¶
Creates a new VoxelBuffer that has the current format.
Depth get_channel_depth( ChannelId channel_index )¶
Gets the depth of a specific channel. See Depth for more information.
void set_channel_depth( ChannelId channel_index, Depth depth )¶
Sets the depth of a specific channel. See Depth for more information.
Generated on Jan 26, 2026