VoxelMesherTransvoxel
Implements isosurface generation (smooth voxels) using the Transvoxel(https://transvoxel.org/) algorithm.
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
public VoxelMesherTransvoxel();Properties7
EdgeClampMarginProperty
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
public bool MeshOptimizationEnabled { get; set; }MeshOptimizationErrorThresholdProperty
public float MeshOptimizationErrorThreshold { get; set; }MeshOptimizationTargetRatioProperty
public float MeshOptimizationTargetRatio { get; set; }TexturesIgnoreAirVoxelsProperty
public bool TexturesIgnoreAirVoxels { get; set; }TexturingModeProperty
public VoxelMesherTransvoxel.TexturingModeEnum TexturingMode { get; set; }TransitionsEnabledProperty
public bool TransitionsEnabled { get; set; }Methods15
BuildTransitionMeshArrayMesh
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.
| Name | Type | Default |
|---|---|---|
voxelBuffer | VoxelBuffer | — |
direction | int | — |
ArrayMeshGetEdgeClampMarginfloat
public float GetEdgeClampMargin();floatGetMeshOptimizationErrorThresholdfloat
public float GetMeshOptimizationErrorThreshold();floatGetMeshOptimizationTargetRatiofloat
public float GetMeshOptimizationTargetRatio();floatGetTexturesIgnoreAirVoxelsbool
public bool GetTexturesIgnoreAirVoxels();boolGetTexturingModeVoxelMesherTransvoxel.TexturingModeEnum
public VoxelMesherTransvoxel.TexturingModeEnum GetTexturingMode();VoxelMesherTransvoxel.TexturingModeEnumGetTransitionsEnabledbool
public bool GetTransitionsEnabled();boolIsMeshOptimizationEnabledbool
public bool IsMeshOptimizationEnabled();boolSetEdgeClampMarginvoid
public void SetEdgeClampMargin(float margin);| Name | Type | Default |
|---|---|---|
margin | float | — |
SetMeshOptimizationEnabledvoid
public void SetMeshOptimizationEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetMeshOptimizationErrorThresholdvoid
public void SetMeshOptimizationErrorThreshold(float threshold);| Name | Type | Default |
|---|---|---|
threshold | float | — |
SetMeshOptimizationTargetRatiovoid
public void SetMeshOptimizationTargetRatio(float ratio);| Name | Type | Default |
|---|---|---|
ratio | float | — |
SetTexturesIgnoreAirVoxelsvoid
public void SetTexturesIgnoreAirVoxels(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetTexturingModevoid
public void SetTexturingMode(VoxelMesherTransvoxel.TexturingModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | VoxelMesherTransvoxel.TexturingModeEnum | — |
SetTransitionsEnabledvoid
public void SetTransitionsEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
Fields and constants1
TexturesBlend4Over16Field · Deprecated
public const long TexturesBlend4Over16 = 1;Legacy alias for VoxelMesherTransvoxel.TexturingModeEnum.Mixel4S4.
VoxelMesherTransvoxel.TexturingModeEnum
| Value | Description |
|---|---|
Mixel4S4 = 1 | Expects voxels to have 4 4-bit indices packed in 16-bit values in |
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 |