reckfellENGINE

VoxelMesherBlocky

Produces a mesh by batching models corresponding to each voxel value, similar to games like Minecraft or StarMade.

On this page
class VoxelMesherBlockyReckfellSharpInherits VoxelMesher

Produces a mesh by batching models corresponding to each voxel value, similar to games like Minecraft or StarMade.

Occluded faces are removed from the result, and some degree of ambient occlusion can be baked on the edges. Values are expected to be in the VoxelBuffer.ChannelId.ChannelType channel. Models are defined with a VoxelBlockyLibrary, in which model indices correspond to the voxel values. Models don't have to be cubes.

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

Constructors1

VoxelMesherBlockyConstructor
# VoxelMesherBlocky
C#
public VoxelMesherBlocky();

Properties10

LibraryProperty
# Library
C#
public VoxelBlockyLibraryBase Library { get; set; }

Library of models that will be used by this mesher. If you are using a mesher without a terrain, make sure you call VoxelBlockyLibraryBase.Bake before building meshes, otherwise results will be empty or out-of-date.

OcclusionDarknessProperty
# OcclusionDarkness
C#
public float OcclusionDarkness { get; set; }
OcclusionEnabledProperty
# OcclusionEnabled
C#
public bool OcclusionEnabled { get; set; }

Enables baked ambient occlusion. To render it, you need a material that applies vertex colors.

ShadowOccluderNegativeXProperty
# ShadowOccluderNegativeX
C#
public bool ShadowOccluderNegativeX { get; set; }

When enabled, generates a quad covering the negative X side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

ShadowOccluderNegativeYProperty
# ShadowOccluderNegativeY
C#
public bool ShadowOccluderNegativeY { get; set; }

When enabled, generates a quad covering the negative Y side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

ShadowOccluderNegativeZProperty
# ShadowOccluderNegativeZ
C#
public bool ShadowOccluderNegativeZ { get; set; }

When enabled, generates a quad covering the negative Z side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

ShadowOccluderPositiveXProperty
# ShadowOccluderPositiveX
C#
public bool ShadowOccluderPositiveX { get; set; }

When enabled, generates a quad covering the positive X side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

ShadowOccluderPositiveYProperty
# ShadowOccluderPositiveY
C#
public bool ShadowOccluderPositiveY { get; set; }

When enabled, generates a quad covering the positive Y side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

ShadowOccluderPositiveZProperty
# ShadowOccluderPositiveZ
C#
public bool ShadowOccluderPositiveZ { get; set; }

When enabled, generates a quad covering the positive Z side of the chunk if it is fully covered by opaque voxels, in order to force directional lights to project a shadow.

TintModeProperty
# TintMode
C#
public VoxelMesherBlocky.TintModeEnum TintMode { get; set; }

Configures a way to apply color from voxel data.

Methods10

GetLibraryVoxelBlockyLibraryBase
# GetLibrary
C#
public VoxelBlockyLibraryBase GetLibrary();
Returns VoxelBlockyLibraryBase
GetOcclusionDarknessfloat
# GetOcclusionDarkness
C#
public float GetOcclusionDarkness();
Returns float
GetOcclusionEnabledbool
# GetOcclusionEnabled
C#
public bool GetOcclusionEnabled();
Returns bool
GetShadowOccluderSidebool
# GetShadowOccluderSide
C#
public bool GetShadowOccluderSide(VoxelMesherBlocky.Side side);
Parameters
NameTypeDefault
sideVoxelMesherBlocky.Side—
Returns bool
GetTintModeVoxelMesherBlocky.TintModeEnum
# GetTintMode
C#
public VoxelMesherBlocky.TintModeEnum GetTintMode();
Returns VoxelMesherBlocky.TintModeEnum
SetLibraryvoid
# SetLibrary
C#
public void SetLibrary(VoxelBlockyLibraryBase voxelLibrary);
Parameters
NameTypeDefault
voxelLibraryVoxelBlockyLibraryBase—
SetOcclusionDarknessvoid
# SetOcclusionDarkness
C#
public void SetOcclusionDarkness(float value);
Parameters
NameTypeDefault
valuefloat—
SetOcclusionEnabledvoid
# SetOcclusionEnabled
C#
public void SetOcclusionEnabled(bool enable);
Parameters
NameTypeDefault
enablebool—
SetShadowOccluderSidevoid
# SetShadowOccluderSide
C#
public void SetShadowOccluderSide(VoxelMesherBlocky.Side side, bool enabled);
Parameters
NameTypeDefault
sideVoxelMesherBlocky.Side—
enabledbool—
SetTintModevoid
# SetTintMode
C#
public void SetTintMode(VoxelMesherBlocky.TintModeEnum mode);
Parameters
NameTypeDefault
modeVoxelMesherBlocky.TintModeEnum—

VoxelMesherBlocky.Side

VoxelMesherBlocky.TintModeEnum

ValueDescription
None = 0

Only use colors from library models.

RawColor = 1

Modulate voxel colors based on the VoxelBuffer.ChannelId.ChannelColor channel. Values are interpreted as being raw RGBA color. If the channel is 16-bit, colors are packed with 4 bits per component. If 32-bits, colors are packed with 8 bits per component. Other depths are not supported. See VoxelTool.ColorToU32 for encoding. You may also change the format of the color channel to use this, see VoxelEntity.Format. Alpha will only have an effect if the material supports transparency, but will not affect how faces are culled by the mesher.

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.