reckfellENGINE

VoxelInstancer

Spawns items on top of voxel surfaces.

On this page
class VoxelInstancerReckfellSharpInherits Entity3D

Spawns items on top of voxel surfaces.

Add-on to voxel nodes, allowing to spawn static elements on the surface. These elements are rendered with hardware instancing, can have collisions, and also be persistent. It must be child of a voxel node.

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

Constructors1

VoxelInstancerConstructor
# VoxelInstancer
C#
public VoxelInstancer();

Properties6

CollisionUpdateBudgetMicrosecondsProperty
# CollisionUpdateBudgetMicroseconds
C#
public int CollisionUpdateBudgetMicroseconds { get; set; }

Hints the maximum time that should be spent updating collisions that are based on distance (see VoxelInstanceLibraryMultiMeshItem.CollisionDistance). This time can still be exceeded if an operation takes longer, but then no further processing will occur until next frame.

FadingDurationProperty
# FadingDuration
C#
public float FadingDuration { get; set; }

How long it takes for fading to complete, in seconds (same for fading in and out). Used when VoxelInstancer.FadingEnabled is active.

FadingEnabledProperty
# FadingEnabled
C#
public bool FadingEnabled { get; set; }

When enabled, a per-instance shader parameter will be updated when instances load in and out, so it can be used to apply a fading effect. The material used by instances must have a shader that has a instance uniform vec2 u_lod_fade; property. X will animate from 0 to 1 during fade in and fade out. Y will be 1 when fading in, and 0 when fading out.

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

Library from which instances to spawn will be taken from.

MeshLodUpdateBudgetMicrosecondsProperty
# MeshLodUpdateBudgetMicroseconds
C#
public int MeshLodUpdateBudgetMicroseconds { get; set; }

Hints the maximum time that should be spent updating mesh LODs (see "mesh LOD" properties on VoxelInstanceLibraryMultiMeshItem). This time can still be exceeded if an operation takes longer, but then no further processing will occur until next frame.

UpModeProperty
# UpMode
C#
public VoxelInstancer.UpModeEnum UpMode { get; set; }

Where to consider the "up" direction is on the terrain when generating instances. See also VoxelInstanceGenerator.

Methods21

DebugDumpAsScenevoid
# DebugDumpAsScene
C#
public void DebugDumpAsScene(string fpath);
Parameters
NameTypeDefault
fpathstring—
DebugGetBlockCountint
# DebugGetBlockCount
C#
public int DebugGetBlockCount();
Returns int
DebugGetBlockInfosReckfell.Collections.Dictionary
# DebugGetBlockInfos
C#
public Reckfell.Collections.Dictionary DebugGetBlockInfos(Vector3 worldPosition, int itemId);
Parameters
NameTypeDefault
worldPositionVector3—
itemIdint—
Returns Reckfell.Collections.Dictionary
DebugGetDrawFlagbool
# DebugGetDrawFlag
C#
public bool DebugGetDrawFlag(VoxelInstancer.DebugDrawFlag flag);
Parameters
NameTypeDefault
flagVoxelInstancer.DebugDrawFlag—
Returns bool
DebugGetInstanceCountsReckfell.Collections.Dictionary
# DebugGetInstanceCounts
C#
public Reckfell.Collections.Dictionary DebugGetInstanceCounts();
Returns Reckfell.Collections.Dictionary
DebugIsDrawEnabledbool
# DebugIsDrawEnabled
C#
public bool DebugIsDrawEnabled();
Returns bool
DebugSetDrawEnabledvoid
# DebugSetDrawEnabled
C#
public void DebugSetDrawEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
DebugSetDrawFlagvoid
# DebugSetDrawFlag
C#
public void DebugSetDrawFlag(VoxelInstancer.DebugDrawFlag flag, bool enabled);
Parameters
NameTypeDefault
flagVoxelInstancer.DebugDrawFlag—
enabledbool—
GetCollisionUpdateBudgetMicrosecondsint
# GetCollisionUpdateBudgetMicroseconds
C#
public int GetCollisionUpdateBudgetMicroseconds();
Returns int
GetFadingDurationfloat
# GetFadingDuration
C#
public float GetFadingDuration();
Returns float
GetFadingEnabledbool
# GetFadingEnabled
C#
public bool GetFadingEnabled();
Returns bool
GetLibraryVoxelInstanceLibrary
# GetLibrary
C#
public VoxelInstanceLibrary GetLibrary();
Returns VoxelInstanceLibrary
GetMeshLodUpdateBudgetMicrosecondsint
# GetMeshLodUpdateBudgetMicroseconds
C#
public int GetMeshLodUpdateBudgetMicroseconds();
Returns int
GetUpModeVoxelInstancer.UpModeEnum
# GetUpMode
C#
public VoxelInstancer.UpModeEnum GetUpMode();
Returns VoxelInstancer.UpModeEnum
RemoveInstancesInSpherevoid
# RemoveInstancesInSphere
C#
public void RemoveInstancesInSphere(Vector3 center, float radius);

Removes all instances having their origin inside the given sphere. Coordinates are local to the instancer.

Parameters
NameTypeDefault
centerVector3—
radiusfloat—
SetCollisionUpdateBudgetMicrosecondsvoid
# SetCollisionUpdateBudgetMicroseconds
C#
public void SetCollisionUpdateBudgetMicroseconds(int micros);
Parameters
NameTypeDefault
microsint—
SetFadingDurationvoid
# SetFadingDuration
C#
public void SetFadingDuration(float duration);
Parameters
NameTypeDefault
durationfloat—
SetFadingEnabledvoid
# SetFadingEnabled
C#
public void SetFadingEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetLibraryvoid
# SetLibrary
C#
public void SetLibrary(VoxelInstanceLibrary library);
Parameters
NameTypeDefault
libraryVoxelInstanceLibrary—
SetMeshLodUpdateBudgetMicrosecondsvoid
# SetMeshLodUpdateBudgetMicroseconds
C#
public void SetMeshLodUpdateBudgetMicroseconds(int micros);
Parameters
NameTypeDefault
microsint—
SetUpModevoid
# SetUpMode
C#
public void SetUpMode(VoxelInstancer.UpModeEnum mode);
Parameters
NameTypeDefault
modeVoxelInstancer.UpModeEnum—

Fields and constants1

MaxLodField
# MaxLod
C#
public const long MaxLod = 8;

VoxelInstancer.DebugDrawFlag

VoxelInstancer.UpModeEnum

ValueDescription
PositiveY = 0

Up is towards the positive Y axis. This is the default assumption in Reckfell.

Sphere = 1

Up is opposite from the direction where the terrain's origin is. May be used if your terrain is a planet for example.

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.