reckfellENGINE

VoxelMesherTransvoxel

Implements isosurface generation (smooth voxels) using the Transvoxel(https://transvoxel.org/) algorithm.

On this page
class VoxelMesherTransvoxelReckfellSharpInherits VoxelMesher

Implements isosurface generation (smooth voxels) using the Transvoxel(https://transvoxel.org/) algorithm.

Uses the Transvoxel(https://transvoxel.org/) algorithm to polygonize smooth voxels. Note: if you want to use LOD, you will need special vertex shader code to properly render seams (otherwise they will render as thin sheets between chunks). Check [url]https://voxel-tools.readthedocs.io/en/latest/smooth_terrain/#transvoxel[/url] or demos featuring smooth terrain for more information.

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

Constructors1

VoxelMesherTransvoxelConstructor
# VoxelMesherTransvoxel
C#
public VoxelMesherTransvoxel();

Properties7

EdgeClampMarginProperty
# EdgeClampMargin
C#
public float EdgeClampMargin { get; set; }

When a marching cube cell is computed, vertices may be placed anywhere on edges of the cell, including very close to corners. This can lead to very thin or small triangles, which can be a problem notably for some physics engines. this margin is the minimum distance from corners, below which vertices will be clamped to it. Increasing this value might reduce quality of the mesh introducing small ridges. This property cannot be lower than 0 (in which case no clamping occurs), and cannot be higher than 0.5 (in which case no interpolation occurs as vertices always get placed in the middle of edges).

MeshOptimizationEnabledProperty
# MeshOptimizationEnabled
C#
public bool MeshOptimizationEnabled { get; set; }
MeshOptimizationErrorThresholdProperty
# MeshOptimizationErrorThreshold
C#
public float MeshOptimizationErrorThreshold { get; set; }
MeshOptimizationTargetRatioProperty
# MeshOptimizationTargetRatio
C#
public float MeshOptimizationTargetRatio { get; set; }
TexturesIgnoreAirVoxelsProperty
# TexturesIgnoreAirVoxels
C#
public bool TexturesIgnoreAirVoxels { get; set; }
TexturingModeProperty
# TexturingMode
C#
public VoxelMesherTransvoxel.TexturingModeEnum TexturingMode { get; set; }
TransitionsEnabledProperty
# TransitionsEnabled
C#
public bool TransitionsEnabled { get; set; }

Methods15

BuildTransitionMeshArrayMesh
# BuildTransitionMesh
C#
public ArrayMesh BuildTransitionMesh(VoxelBuffer voxelBuffer, int direction);

Generates only the part of the mesh that Transvoxel uses to connect surfaces with different level of detail. This method is mainly for testing purposes.

Parameters
NameTypeDefault
voxelBufferVoxelBuffer—
directionint—
Returns ArrayMesh
GetEdgeClampMarginfloat
# GetEdgeClampMargin
C#
public float GetEdgeClampMargin();
Returns float
GetMeshOptimizationErrorThresholdfloat
# GetMeshOptimizationErrorThreshold
C#
public float GetMeshOptimizationErrorThreshold();
Returns float
GetMeshOptimizationTargetRatiofloat
# GetMeshOptimizationTargetRatio
C#
public float GetMeshOptimizationTargetRatio();
Returns float
GetTexturesIgnoreAirVoxelsbool
# GetTexturesIgnoreAirVoxels
C#
public bool GetTexturesIgnoreAirVoxels();
Returns bool
GetTexturingModeVoxelMesherTransvoxel.TexturingModeEnum
# GetTexturingMode
C#
public VoxelMesherTransvoxel.TexturingModeEnum GetTexturingMode();
Returns VoxelMesherTransvoxel.TexturingModeEnum
GetTransitionsEnabledbool
# GetTransitionsEnabled
C#
public bool GetTransitionsEnabled();
Returns bool
IsMeshOptimizationEnabledbool
# IsMeshOptimizationEnabled
C#
public bool IsMeshOptimizationEnabled();
Returns bool
SetEdgeClampMarginvoid
# SetEdgeClampMargin
C#
public void SetEdgeClampMargin(float margin);
Parameters
NameTypeDefault
marginfloat—
SetMeshOptimizationEnabledvoid
# SetMeshOptimizationEnabled
C#
public void SetMeshOptimizationEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetMeshOptimizationErrorThresholdvoid
# SetMeshOptimizationErrorThreshold
C#
public void SetMeshOptimizationErrorThreshold(float threshold);
Parameters
NameTypeDefault
thresholdfloat—
SetMeshOptimizationTargetRatiovoid
# SetMeshOptimizationTargetRatio
C#
public void SetMeshOptimizationTargetRatio(float ratio);
Parameters
NameTypeDefault
ratiofloat—
SetTexturesIgnoreAirVoxelsvoid
# SetTexturesIgnoreAirVoxels
C#
public void SetTexturesIgnoreAirVoxels(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetTexturingModevoid
# SetTexturingMode
C#
public void SetTexturingMode(VoxelMesherTransvoxel.TexturingModeEnum mode);
Parameters
NameTypeDefault
modeVoxelMesherTransvoxel.TexturingModeEnum—
SetTransitionsEnabledvoid
# SetTransitionsEnabled
C#
public void SetTransitionsEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—

Fields and constants1

TexturesBlend4Over16Field · Deprecated
# TexturesBlend4Over16
C#
public const long TexturesBlend4Over16 = 1;

Legacy alias for VoxelMesherTransvoxel.TexturingModeEnum.Mixel4S4.

VoxelMesherTransvoxel.TexturingModeEnum

ValueDescription
Mixel4S4 = 1

Expects voxels to have 4 4-bit indices packed in 16-bit values in VoxelBuffer.ChannelId.ChannelIndices, and 4 4-bit weights in VoxelBuffer.ChannelId.ChannelWeights. Adds texturing information as 4 texture indices and 4 weights, encoded in CUSTOM1.xy in Reckfell fragment shaders, where x and y contain 4 packed 8-bit values. In cases where more than 4 textures cross each other in a 2x2x2 voxel area, triangles in that area will only use the 4 indices with the highest weights. A custom shader is required to render this, usually with texture arrays to index textures easily.

None = 0

Disables texturing information. This mode is the fastest if you can use a shader to apply textures procedurally.

SingleS4 = 2

Expects voxels to have a 8-bit texture index in the VoxelBuffer.ChannelId.ChannelIndices channel. Adds texturing information as 4 texture indices and 4 weights, encoded in CUSTOM1.xy in Reckfell fragment shaders, where x and y contain 4 packed 8-bit values. In cases where more than 4 textures cross each other in a 2x2x2 voxel area, triangles in that area will only use the 4 indices with the highest weights. A custom shader is required to render this, usually with texture arrays to index textures easily.

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.