reckfellENGINE

VoxelGeneratorMultipassCB

Scriptable generator working on columns of blocks and multiple passes.

On this page
class VoxelGeneratorMultipassCBReckfellSharpInherits VoxelGenerator

Scriptable generator working on columns of blocks and multiple passes.

This generator can be implemented with a script to generate terrain in columns of blocks instead of only block by block. It allows to use multiple passes, where every pass can access results of the previous ones, and allowing access to neighbor columns. The height of columns is not infinite, but it is possible to define what generates above and below, using a single-pass per-block fallback. It may only be used with VoxelTerrain.

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

Constructors1

VoxelGeneratorMultipassCBConstructor
# VoxelGeneratorMultipassCB
C#
public VoxelGeneratorMultipassCB();

Properties3

ColumnBaseYBlocksProperty
# ColumnBaseYBlocks
C#
public int ColumnBaseYBlocks { get; set; }

Lowest altitude of columns, in blocks.

ColumnHeightBlocksProperty
# ColumnHeightBlocks
C#
public int ColumnHeightBlocks { get; set; }

Height of columns, in blocks.

PassCountProperty
# PassCount
C#
public int PassCount { get; set; }

Number of passes columns will go through before being considered fully generated. More passes increases memory and processing cost.

Methods12

DebugGenerateTestColumnReckfell.Collections.Array<VoxelBuffer>
# DebugGenerateTestColumn
C#
public Reckfell.Collections.Array<VoxelBuffer> DebugGenerateTestColumn(Vector2I columnPositionBlocks);

Testing method that will fully generate all blocks of a specific column, and returns them. This function doesn't use any threads and doesn't use the internal cache, so it will be very slow. However, it allows to test or debug your script more easily, using an isolated scene for example.

Parameters
NameTypeDefault
columnPositionBlocksVector2I—
Returns Reckfell.Collections.Array<VoxelBuffer>
GetColumnBaseYBlocksint
# GetColumnBaseYBlocks
C#
public int GetColumnBaseYBlocks();
Returns int
GetColumnHeightBlocksint
# GetColumnHeightBlocks
C#
public int GetColumnHeightBlocks();
Returns int
GetPassCountint
# GetPassCount
C#
public int GetPassCount();
Returns int
GetPassExtentBlocksint
# GetPassExtentBlocks
C#
public int GetPassExtentBlocks(int passIndex);

Gets how many blocks a pass can access around it (note: a block is 16x16x16 voxels by default).

Parameters
NameTypeDefault
passIndexint—
Returns int
SetColumnBaseYBlocksvoid
# SetColumnBaseYBlocks
C#
public void SetColumnBaseYBlocks(int y);
Parameters
NameTypeDefault
yint—
SetColumnHeightBlocksvoid
# SetColumnHeightBlocks
C#
public void SetColumnHeightBlocks(int y);
Parameters
NameTypeDefault
yint—
SetPassCountvoid
# SetPassCount
C#
public void SetPassCount(int count);
Parameters
NameTypeDefault
countint—
SetPassExtentBlocksvoid
# SetPassExtentBlocks
C#
public void SetPassExtentBlocks(int passIndex, int extent);

Sets how many blocks a pass can access around columns when they generate (note: a block is 16x16x16 voxels by default). By design, the first pass is not allowed to access neighbors, so it will remain 0. Following passes are designed to access at least 1 block away. Such passes don't support 0 because it would be the same as simply putting your logic in a previous pass. Increasing extent will also increase the cost of the generator, both in memory and processing time, so it should be balanced with caution.

Parameters
NameTypeDefault
passIndexint—
extentint—
_GenerateBlockFallbackvoid
# _GenerateBlockFallback
C#
public virtual void _GenerateBlockFallback(VoxelBuffer outBuffer, Vector3I originInVoxels);

Called for every block to generate above or below the column-based region. For example you can decide to generate air above, and bedrock below.

Parameters
NameTypeDefault
outBufferVoxelBuffer—
originInVoxelsVector3I—
_GeneratePassvoid
# _GeneratePass
C#
public virtual void _GeneratePass(VoxelToolMultipassGenerator voxelTool, int passIndex);

Called once per pass for every column of blocks. The passed voxel_tool must be used to get information about the area to generate, and fill/edit this area with voxels. Important: do not keep this object in a member variable for later re-use. You can only use it in the current call to this method. You may use pass_index to do something different in each pass. For example, 0 could be base ground with Perlin noise, 1 could plant trees and other structures.

Parameters
NameTypeDefault
voxelToolVoxelToolMultipassGenerator—
passIndexint—
_GetUsedChannelsMaskint
# _GetUsedChannelsMask
C#
public virtual int _GetUsedChannelsMask();

Use this to indicate which channels your generator will use. It returns a bitmask, so for example you may provide information like this: (1 << channel1) | (1 << channel2)

Returns int

Fields and constants2

MaxPassExtentField
# MaxPassExtent
C#
public const long MaxPassExtent = 2;
MaxPassesField
# MaxPasses
C#
public const long MaxPasses = 4;
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.