reckfellENGINE

VoxelEntity

Base class for voxel volumes.

On this page
class VoxelEntityReckfellSharpInherits Entity3D

Base class for voxel volumes.

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

Properties7

CastShadowProperty
# CastShadow
C#
public GeometryInstance3D.ShadowCastingSetting CastShadow { get; set; }

Sets the shadow casting mode that meshes of the terrain will use.

FormatProperty
# Format
C#
public VoxelFormat Format { get; set; }

Overrides the default format of voxels. WARNING: changing this will reload the terrain. If it has a stream attached with data saved with a different format, it might load improperly.

GIModeProperty
# GIMode
C#
public GeometryInstance3D.GIModeEnum GIMode { get; set; }

Sets the Global Illumination mode meshes of the terrain will use.

GeneratorProperty
# Generator
C#
public VoxelGenerator Generator { get; set; }

Procedural generator used to load voxel blocks when not present in the stream.

MesherProperty
# Mesher
C#
public VoxelMesher Mesher { get; set; }

Defines how voxels are transformed into visible meshes.

RenderLayersMaskProperty
# RenderLayersMask
C#
public int RenderLayersMask { get; set; }

Sets the render layers meshes of the terrain will use.

StreamProperty
# Stream
C#
public VoxelStream Stream { get; set; }

Primary source of persistent voxel data. If left unassigned, the whole volume will use the generator.

Methods16

ConvertToEntitiesEntity3D
# ConvertToEntities
C#
public Entity3D ConvertToEntities(VoxelEntity.EntityConversionFlags flags);

Generates a tree representing the terrain at the time of calling, only using Reckfell vanilla nodes. This method can be used as a way to produce a snapshot of the terrain as a vanilla scene that can be opened with standard Reckfell versions without plugins. It could also be used for debug purposes, or as a way to workaround Reckfell features that expect mesh instance nodes (such as some GI baking options, navigation generation or GLTF export). The returned root is not added to the scene tree. It is up to you to decide what to do with it. If you want it to be present in the scene, you should add it as child of an existing node. Otherwise, don't forget to free it. Output structure: every chunk of the terrain will create its own MeshInstance3D, with a unique ArrayMesh resource attached to it. Meshes and/or mesh instances may also have materials attached to them. Depending on how the terrain is configured, these materials can be unique per chunk. If the terrain has LODs, chunks will be stored under a corresponding LOD node. If the terrain has an instancer, multimesh chunks can be included. See VoxelEntity.EntityConversionFlags for options. Resources: unless specified, resources attached to nodes of the tree will be direct references to those actually used by the terrain system. Careful, depending on configuration, it is possible that they get altered when the terrain runs its next process cycle (for example, materials with per-chunk parameters are pooled, so when chunks get unloaded, those referenced in the nodes might drastically change as new chunks re-use them). Performance: this can be an expensive operation. It might slow down your game. Packing to scene file: it is possible to save the output as a PackedEntity, by assigning Entity.Owner (see Reckfell's documentation). It contains a lot of unique meshes so the saved scenes can be very large. Prefer saving as binary .rbin if it's a problem. If the terrain uses a ShaderMaterial with detail rendering, chunks will also have unique textures, further increasing size. GLTF: if your terrain uses ShaderMaterial and you want to convert the terrain to a GltfDocument, these materials won't carry over because GLTF does not support it. That also means if you use VoxelMesherTransvoxel with LOD, meshes in your GLTF document will have unwanted extra geometry and cracks at the seams (which would normally be handled by shader). LOD: if your terrain has LOD, you will only get a snapshot of which LODs are currently active. Detailed meshes will be centered around viewers, and have less and less details further away.

Parameters
NameTypeDefault
flagsVoxelEntity.EntityConversionFlags—
Returns Entity3D
GetFormatVoxelFormat
# GetFormat
C#
public VoxelFormat GetFormat();
Returns VoxelFormat
GetGIModeGeometryInstance3D.GIModeEnum
# GetGIMode
C#
public GeometryInstance3D.GIModeEnum GetGIMode();
Returns GeometryInstance3D.GIModeEnum
GetGeneratorVoxelGenerator
# GetGenerator
C#
public VoxelGenerator GetGenerator();
Returns VoxelGenerator
GetMesherVoxelMesher
# GetMesher
C#
public VoxelMesher GetMesher();
Returns VoxelMesher
GetRenderLayersMaskint
# GetRenderLayersMask
C#
public int GetRenderLayersMask();
Returns int
GetShadowCastingGeometryInstance3D.ShadowCastingSetting
# GetShadowCasting
C#
public GeometryInstance3D.ShadowCastingSetting GetShadowCasting();
Returns GeometryInstance3D.ShadowCastingSetting
GetStreamVoxelStream
# GetStream
C#
public VoxelStream GetStream();
Returns VoxelStream
GetVoxelToolVoxelTool
# GetVoxelTool
C#
public VoxelTool GetVoxelTool();

Creates an instance of VoxelTool bound to this node, to access voxels and edition methods. You can keep it in a member variable to avoid creating one again, as long as the node still exists.

Returns VoxelTool
SetFormatvoid
# SetFormat
C#
public void SetFormat(VoxelFormat format);
Parameters
NameTypeDefault
formatVoxelFormat—
SetGIModevoid
# SetGIMode
C#
public void SetGIMode(GeometryInstance3D.GIModeEnum mode);
Parameters
NameTypeDefault
modeGeometryInstance3D.GIModeEnum—
SetGeneratorvoid
# SetGenerator
C#
public void SetGenerator(VoxelGenerator generator);
Parameters
NameTypeDefault
generatorVoxelGenerator—
SetMeshervoid
# SetMesher
C#
public void SetMesher(VoxelMesher mesher);
Parameters
NameTypeDefault
mesherVoxelMesher—
SetRenderLayersMaskvoid
# SetRenderLayersMask
C#
public void SetRenderLayersMask(int mask);
Parameters
NameTypeDefault
maskint—
SetShadowCastingvoid
# SetShadowCasting
C#
public void SetShadowCasting(GeometryInstance3D.ShadowCastingSetting mode);
Parameters
NameTypeDefault
modeGeometryInstance3D.ShadowCastingSetting—
SetStreamvoid
# SetStream
C#
public void SetStream(VoxelStream stream);
Parameters
NameTypeDefault
streamVoxelStream—

VoxelEntity.EntityConversionFlags

ValueDescription
Instancer = 1

If the terrain has a VoxelInstancer, instances spawned by it will be included in the result as a MultiMeshInstance per chunk.

InvisibleBlocks = 2

Some chunks are internally hidden by the terrain system, notably as part of the LOD system. If this flag is provided, these chunks will be included in the output.

MaterialOverrides = 4

Specifies that material overrides present on the terrain should be applied to chunks of the result.

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.