@voxelize/core
Enumerations
Core Classes
Effects Classes
Other Classes
- AngleSpring
- AnimationUtils
- Arm
- Arrow
- AtlasTexture
- AttackMotion
- BlockAnimations
- BlockProfileTable
- BlockRotation
- BoneTextureManager
- BoundedLruMap
- BoxLayer
- CSMRenderer
- CanvasBox
- Character
- Chunk
- ChunkMaterial
- ChunkPipeline
- ChunkRegionArenas
- ChunkRenderer
- ChunkSharedPool
- Clouds
- Creature
- DeathAnimation
- Debug
- Entities
- Entity
- EntityLivenessTracker
- Events
- FaceAnimation
- FarTerrain
- GaitFoot
- GaitState
- HeadLedBody
- HeadLookMotion
- IkChain
- ImageItemRenderer
- InstancedEntity
- InstancedEntityRoster
- InstancedSkinnedDepthMaterial
- InstancedSkinnedMaterial
- IsolatedFaceLedger
- ItemRegistry
- ItemRenderer
- ItemSlot
- ItemSlots
- LightClusterGrid
- LightCones
- LightSourceRegistry
- LocalLightAirlight
- LocalLightAirlightEffect
- LocalLights
- LocalShadowAtlas
- LocalShadowScheduler
- MemoryPressureMonitor
- MeshPipeline
- Method
- NameTag
- Network
- OrderIndependentTransparency
- Perspective
- Portrait
- Registry
- SectionTracker
- SectionVisibilityGraph
- SeeThroughTexelSplit
- ShaderClock
- ShadowFrameLedger
- SkinnedInstancePool
- Sky
- SpriteText
- StaticGroup
- StrideGait
- ThreeUtils
- VolumetricClouds
- VoxelBoxTexelFrame
- VoxelBoxWork
- VoxelInteract
- WaterOptics
- WebRTCConnection
- WorkerPool
- WorkerTransfer
Utils Classes
Interfaces
- AttackMotionPose
- AttackMotionProfile
- BlockAnimationHost
- BlockConditionalPart
- BlockDynamicPattern
- BlockLightProfile
- BudgetedDrain
- CSMConfig
- CSMShadowLedger
- ChainBinding
- ChunkLoadTiming
- ChunkMaterialHost
- ChunkRequestHistory
- ChunkRoundTrip
- CoupledWorldView
- EmitterBlock
- FabrikSolveOptions
- FlickerProfile
- GaitProfile
- GaitReachInput
- HeadLookResult
- ImageComp
- ImageItemMeshData
- InstallSkinnedFamilyOptions
- InstancedEntityData
- InstancedEntityOptions
- InstancedSkinnedMaterialOptions
- ItemDef
- LazyWorkEntry
- LocalLightDescriptor
- LocalLightSample
- LocalLightStats
- LocalLightsOptions
- LocalLightsWorldConfig
- NetIntercept
- PartBoxDims
- RosterWarmupOptions
- RosterWarmupStats
- ScannableChunk
- ShadowInvalidationEntry
- ShadowTexelRecord
- SkinnedFamily
- SkinnedFamilyConfig
- SkinnedFamilyDefinition
- SkinnedPart
- SkinnedPose
- SkinnedRigInfo
- SkinnedTextureSource
- StrideGaitParams
- TexelDensity
- TransparentMediumSource
- TransparentMeshData
- TwoBoneIkLimb
- VoxelLightVolume
- WarmablePool
Type Aliases
AirlightInput
Ƭ AirlightInput: Object
Type declaration
| Name | Type | Description |
|---|---|---|
cameraX | number | - |
cameraY | number | - |
cameraZ | number | - |
daylight | number | 0..1: how much of the camera's surroundings the sun lights now. |
grid | LightClusterGrid | - |
isVisible | (fromX: number, fromY: number, fromZ: number, toX: number, toY: number, toZ: number, tolerance: number) => boolean | - |
nowMs | number | - |
registry | LightSourceRegistry | - |
skyExposure | number | 0..1: how far under open sky the camera stands. |
submersion | number | 0..1 camera submersion; the air layer yields to the water optics. |
tier | LightQualityTier | - |
ArgMetadata
Ƭ ArgMetadata: Object
Metadata extracted from a Zod schema for UI purposes.
Type declaration
| Name | Type |
|---|---|
defaultValue? | string | number | boolean |
name | string |
options? | string[] |
required | boolean |
tabComplete? | (currentValue: string, context: TabCompleteContext) => string[] |
type | "string" | "number" | "enum" | "boolean" |
ArmIdleSway
Ƭ ArmIdleSway: Object
A slow breathing sway the held object makes while it is at rest: neither swinging nor being swapped. It is laid on top of the rest pose each frame and taken off again before the next, so it never accumulates, and it keeps real time, so every frame rate sees the same sway.
Type declaration
| Name | Type | Description |
|---|---|---|
breathLift | number | How far it rises at the top of a breath. |
breathSeconds | number | Seconds per breath. |
breathTilt | number | How far it tips back toward the eye at the top of a breath, radians. |
driftReach | number | How far it drifts to either side. |
driftRoll | number | How far it rolls into the drift, radians. |
driftSeconds | number | Seconds per drift from one side to the other and back. Not a multiple of a breath, so the two never settle into one short loop. |
fadeInSeconds | number | Seconds it takes to come in once the object is at rest. |
fadeOutSeconds | number | Seconds it takes to leave when a swing starts. |
pivot | THREE.Vector3 | The point it sways about, in the arm's frame: where it is held. |
ArmObjectOptions
Ƭ ArmObjectOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
fixedFov? | number | The field of view, in degrees, the object is posed for. While it is held, the arm keeps it the size and place on screen it has at that field of view, whatever Arm.viewCamera is drawn at, so a pose tuned once holds when a player widens or narrows the view. Unset, the object follows the camera's field of view like the world does. |
idleSway? | ArmIdleSway | A breathing sway while the object is at rest. None by default. |
position | THREE.Vector3 | - |
quaternion | THREE.Quaternion | - |
swingPositions? | THREE.Vector3[] | - |
swingQuaternions? | THREE.Quaternion[] | - |
swingRestartAfter? | number | How far through a swing (0 to 1) it has to be before another swing request restarts it. Earlier requests are dropped, and not sent to peers, so a strike that has started always lands. 0, the default, restarts on every request. |
swingRestartBlend? | number | Seconds a restarted swing takes to ease out of the pose it interrupted instead of snapping to its first key. 0, the default, snaps. |
swingTimes? | number[] | - |
ArmOptions
Ƭ ArmOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
armColor? | string | THREE.Color | - |
armObject? | THREE.Object3D | - |
armObjectOptions | ArmObjectOptions | - |
armTexture? | THREE.Texture | - |
blockObjectOptions? | ArmObjectOptions | - |
customObjectOptions? | Record<string, ArmObjectOptions> | - |
minOccluderDepth? | number | - |
receiveHeldObjectShadows? | boolean | - |
receiveShadows? | boolean | - |
recoveryDip? | number | How far whatever the arm holds sinks below its rest, in the arm's units, while Arm.recovery is 0: a game whose swings land harder for waiting shows the hand coming back. It rises with the recovery, late (by the cube of it), so it is up only once the next swing is full. 0, the default, never sinks. |
shadowReach? | number | How far the viewmodel reaches into the world, as a share of the distance it is drawn at: placed with Arm.updateShadowBody, its shadows are looked up at that scale about the eye, so a block drawn two blocks down the screen is shaded where a hand would hold it. |
ArmsOptions
Ƭ ArmsOptions: ColorCanvasBoxOptions & { shoulderDrop?: number ; shoulderGap?: number }
Parameters to create a character's arms. Defaults to:
{
gap: 0.1 * CHARACTER_SCALE,
layers: 1,
side: THREE.DoubleSide,
width: 0.25 * CHARACTER_SCALE,
widthSegments: 8,
height: 0.5 * CHARACTER_SCALE,
heightSegments: 16,
depth: 0.25 * CHARACTER_SCALE,
depthSegments: 8,
shoulderGap: 0.05 * CHARACTER_SCALE,
shoulderDrop: 0.25 * CHARACTER_SCALE,
}
ArrayUniform
Ƭ ArrayUniform<T, N>: Object
A uniform array the CPU edits in place: value is the array of three
objects (or numbers) writers mutate, node the TSL buffer that copies
them to the GPU once a render.
Type parameters
| Name | Type |
|---|---|
T | T |
N | extends ArrayElementType |
Type declaration
| Name | Type |
|---|---|
node | UniformArrayNode<N> |
value | T[] |
ArrowOptions
Ƭ ArrowOptions: Object
Parameters to create an arrow.
Type declaration
| Name | Type | Description |
|---|---|---|
color | string | Color | The color of the arrow. Defaults to red. |
coneHeight | number | The height of the head of the arrow. Defaults to 0.2. |
coneRadius | number | The radius of the head of the arrow. Defaults to 0.2. |
height | number | The height of the body of the arrow. Defaults to 0.8. |
radius | number | The radius of the body of the arrow. Defaults to 0.1. |
ArtFunction
Ƭ ArtFunction: (context: CanvasRenderingContext2D, canvas: HTMLCanvasElement) => void
A function to programmatically draw on a canvas.
Type declaration
▸ (context, canvas): void
Parameters
| Name | Type |
|---|---|
context | CanvasRenderingContext2D |
canvas | HTMLCanvasElement |
Returns
void
AtlasFilteringMode
Ƭ AtlasFilteringMode: "nearest" | "mip-aniso"
See WorldOptions.blockTextureFiltering.
BiomeTintAtOptions
Ƭ BiomeTintAtOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
chunkSize | number | - |
cornersAt | (cx: number, cz: number) => Uint8Array | undefined | - |
lights | Uint32Array | Int32Array | - |
origin | [number, number, number] | World position, in blocks, of a vertex whose position is zero. |
positionBias | number | - |
positionUnits | number | - |
positions | Float32Array | Uint16Array | - |
BlendedKind
Ƭ BlendedKind: "straight" | "premultiplied"
How a blended material's colour reaches the accumulation.
BlendedPassInputs
Ƭ BlendedPassInputs: Object
See ChunkShadingInputs.blended.
Type declaration
| Name | Type | Description |
|---|---|---|
phase | FloatNode | 0 all, 1 what lies behind the separating surface, 2 the rest. |
separatorBias | FloatNode | - |
separatorDepth | { sample: (uv: Vec2Node) => { level: (level: FloatNode) => Vec4Node } } | - |
separatorDepth.sample | [object Object] | - |
Block
Ƭ Block: Object
A block type in the world. This is defined by the server.
Type declaration
| Name | Type | Description |
|---|---|---|
aabbs | AABB[] | A list of axis-aligned bounding boxes that this block has. |
barrierHeight? | number | How high, in blocks above its voxel's floor, the bodies the server simulates find this block standing (each of its boxes raised to it). Absent for a block with no barrier. The client's own body still collides with the declared boxes; the physics engine reads it through World.getBarrierTopAt only to keep automatic moves (auto-jump, auto-step) from carrying the body over. Mirrors the server barrier_height field. |
blueLightLevel | number | The blue light level of the block. |
branch | BranchShape | null | Draws every voxel of this block as a branch of the radius its stage holds, joined to its neighbours. null for an ordinary block. Mirrors the server branch field; collision and picking follow the drawn shape through branchAABBsAt. |
branchShell | boolean | Draws every voxel of this block as a cell of a wide branch section: its slice of the tube of the core its raw bits point at, wearing that core's faces. Mirrors the server branch_shell. |
branchSockets | BranchSocket[] | The branches this block takes without being one (a leaf, a soil). |
castsShadow | boolean | null | Whether this block is drawn into the sun's shadow maps. null defers to blockCastsShadow's rule of thumb; a block the rule gets wrong (a door: see-through to the mesher, a plank slab to the eye) says so here. Mirrors the server casts_shadow field. |
coupledParts | CoupledPart[] | The other voxels of the multi-voxel unit this block is one part of — a door's other leaf, a tall flower's other half. Empty for an ordinary block. The server keeps such units whole at update intake; the client mirrors that in World.updateVoxels so predictions land on the same voxels. Mirrors the server coupled_parts field. |
defaultEntityJson? | string | null | Server-authored initial data for this block's entity. |
dynamicFn | (pos: Coords3) => { aabbs: Block["aabbs"] ; faces: Block["faces"] ; isTransparent: Block["isTransparent"] } | - |
dynamicPatterns | BlockDynamicPattern[] | - |
faces | { corners: { pos: [number, number, number] ; uv: number[] }[] ; dir: [number, number, number] ; emissive?: number ; independent: boolean ; isolated: boolean ; name: string ; pigmentMask?: number ; range: UV ; regionalTint?: boolean ; stageTintMask?: number ; textureGroup: string | null }[] | A list of block face data that this block has. |
fluidFlowForce | number | The force applied to entities in this fluid, pushing them in the flow direction. |
greenLightLevel | number | The green light level of the block. |
groundFrictionMultiplier | number | Multiplier applied to entity ground friction while standing on this block. 1 is normal grip; lower values are slipperier. |
id | number | The block id. |
independentFaces | Set<string> | A set of block face names that are independent (high resolution or animated). This is generated on the client side. |
isAnimated | boolean | Whether every voxel of this block is meshed as its own geometry (never merged into the chunk's shared buffers) so World.blockAnimations can move one voxel's faces on their own — a door leaf swinging on its hinge. Mirrors the server is_animated field. |
isClimbable | boolean | Whether or not can entities climb this block. |
isCoupledAnchor | boolean | Whether this part is its unit's anchor: the part that is placed, picked and dropped, and whose rotation and stage the other parts follow. |
isDynamic | boolean | Whether or not does the block generate dynamic faces or AABB's. If this is true, the block will use dynamicFn to generate the faces and AABB's. |
isEmpty | boolean | Whether or not is this block empty. By default, only "air" is empty. |
isEntity | boolean | - |
isFluid | boolean | Whether or not is the block a fluid block. |
isLight | boolean | Whether or not is this block a light source. |
isOpaque | boolean | Whether or not is this block opaque (not transparent). |
isPassable | boolean | Whether or not should physics ignore this block. |
isPlant | boolean | Whether this block is plant decoration — a grass tuft, a flower, a crop. The mesher uses it to jitter diagonal faces; the renderer uses it to decide what WorldClientOptions.plantDetailDistance may stop drawing. |
isSeeThrough | boolean | Whether or not is this block see-through (can be opaque and see-through at the same time). |
isTransparent | [boolean, boolean, boolean, boolean, boolean, boolean] | Whether or not is this block transparent viewing from all six sides. The sides are defined as PX, PY, PZ, NX, NY, NZ. |
isWaterloggable | boolean | Whether this block can hold the world's waterlogging fluid alongside itself. Whether a given voxel actually does is per-voxel state, read with World.getVoxelWaterloggedAt. |
isWaterloggingFluid | boolean | Whether this is the fluid that waterlogging fills voxels with. |
isolatedFaces | Set<string> | - |
lightAttenuation | number | Optical density for Beer-Lambert light transmission through this block. 0 keeps normal air rules. 1 is leaves-scale. 2 is water-scale. |
name | string | The name of the block. |
redLightLevel | number | The red light level of the block. |
rotatable | boolean | Whether or not is the block rotatable. |
rotationBitsAreState | boolean | Raw bits 16-23 of this block's voxels hold the block's own state, not a rotation: World.getVoxelRotationAt reads the identity rotation for it, and its rotation cannot be set. Mirrors the server rotation_bits_are_state. |
stackGroup | number | Vertical-run id shared by blocks that should shade/sway as one column (peony bottom+top, kelp+lantern). Zero means the block never stacks. Mirrors the server stack_group field. |
stageFaces? | { faces: Block["faces"] ; mask: number } | null | The faces a voxel wears instead of faces while its stage holds any of mask's bits: the same cube in another look, each face standing in for the face toward the same side. null (or absent) for a block with one look. Mirrors the server stage_faces. |
standaloneFaceDepth | number | With transparentStandalone, how many voxels in from either side of a mass of this block the faces between its voxels are still meshed, along each face's axis; 0 meshes every layer. A depth also makes a see-through cube a cutout mass, drawn single-sided with inward copies of its surface (see isClosedCutoutCube). |
swimSpeedMultiplier | number | Multiplier applied to an entity's swim speed while this block is the fluid at its feet. 1 is normal swim speed; a viscous fluid (lava) should be lower. |
transparentStandalone | boolean | - |
tufts? | { faces: Block["faces"] ; jitter: number ; stageFaces?: Block["faces"] ; tilt?: number } | null | Loose quads a voxel wears over its cube while one of its six neighbours is empty, turned, leant by up to tilt radians and nudged by up to jitter blocks per voxel; stageFaces (when not empty) are worn instead while the stage picks stageFaces. They share the atlas. null (or absent) for a block without them. Mirrors the server tufts. |
yRotatable | boolean | Whether or not the block is rotatable around the y-axis (has to face either PX or NX). |
yRotatableSegments | "All" | "Eight" | "Four" | - |
BlockAnimation
Ƭ BlockAnimation: Object
Type declaration
| Name | Type | Description |
|---|---|---|
axis | Coords3 | The hinge axis, in the same frame; it turns with the block. |
durationMs | number | How long a move between two rest poses takes. |
easing? | BlockAnimationEasing | Progress curve over 0..1; defaults to easeOutCubic. |
pivot | Coords3 | The hinge point, in the block's unrotated 0..1 frame. |
restPose | (state: BlockAnimationState) => BlockRestPose | - |
BlockAnimationEasing
Ƭ BlockAnimationEasing: (t: number) => number
Type declaration
▸ (t): number
Parameters
| Name | Type |
|---|---|
t | number |
Returns
number
BlockAnimationState
Ƭ BlockAnimationState: Object
The voxel state a rest pose is asked for.
Type declaration
| Name | Type | Description |
|---|---|---|
raw | number | The packed voxel word, for anything the two fields below leave out. |
rotation | BlockRotation | - |
stage | number | - |
BlockAnimationsSnapshot
Ƭ BlockAnimationsSnapshot: Object
The state BlockAnimations.snapshot reports.
Type declaration
| Name | Type | Description |
|---|---|---|
activeCount | number | - |
registered | string[] | Lower-cased block names with a declared motion. |
trackedCount | number | - |
voxels | { angle: number ; block: string ; isMoving: boolean ; progress: number ; restAngle: number ; stage: number ; voxel: Coords3 }[] | - |
BlockEntityUpdateData
Ƭ BlockEntityUpdateData<T>: Object
Type parameters
| Name |
|---|
T |
Type declaration
| Name | Type |
|---|---|
etype | string |
id | string |
newValue | T | null |
oldValue | T | null |
operation | EntityOperation |
voxel | Coords3 |
BlockEntityUpdateListener
Ƭ BlockEntityUpdateListener<T>: (args: BlockEntityUpdateData<T>) => void
Type parameters
| Name |
|---|
T |
Type declaration
▸ (args): void
Parameters
| Name | Type |
|---|---|
args | BlockEntityUpdateData<T> |
Returns
void
BlockRestPose
Ƭ BlockRestPose: Object
Where a state's geometry rests, relative to the stage-0 geometry: turned
angle radians about the hinge, and displaced by offset (block-local,
before the block's rotation).
Type declaration
| Name | Type |
|---|---|
angle | number |
offset? | Coords3 |
BlockRule
Ƭ BlockRule: { type: "none" } | { type: "simple" } & BlockSimpleRule | { logic: BlockRuleLogic ; rules: BlockRule[] ; type: "combination" }
BlockSimpleRule
Ƭ BlockSimpleRule: Object
Type declaration
| Name | Type |
|---|---|
id? | number |
offset | Coords3 |
rotation? | BlockRotation | SerializedBlockRotation |
stage? | number |
BlockUpdate
Ƭ BlockUpdate: Object
A block update to make on the server.
Type declaration
| Name | Type | Description |
|---|---|---|
isWaterlogged? | boolean | Whether the updated voxel holds the world's waterlogging fluid alongside its block. |
rotation? | number | The optional rotation of the updated block. |
stage? | number | The optional stage of the updated block. |
stateBits? | number | Bits 16-23 of the word for a block whose rotation bits are state (Block.rotationBitsAreState), written exactly as they are and never decoded as a rotation. Only the server authors them; a client update leaves them zero. |
type | number | The voxel type. |
vx | number | The voxel x-coordinate. |
vy | number | The voxel y-coordinate. |
vz | number | The voxel z-coordinate. |
waterlogLevel? | number | The level of the waterlogging fluid the updated voxel holds, 0 through 7. |
yRotation? | number | The optional y-rotation of the updated block. |
BlockUpdateListener
Ƭ BlockUpdateListener: (args: { newValue: number ; oldValue: number ; source: "client" | "server" ; voxel: Coords3 }) => void
Type declaration
▸ (args): void
Parameters
| Name | Type |
|---|---|
args | Object |
args.newValue | number |
args.oldValue | number |
args.source | "client" | "server" |
args.voxel | Coords3 |
Returns
void
BlockUpdateWithSource
Ƭ BlockUpdateWithSource: Object
Type declaration
| Name | Type |
|---|---|
source | "client" | "server" |
update | BlockUpdate |
BodyOptions
Ƭ BodyOptions: ColorCanvasBoxOptions
Parameters to create a character's body. Defaults to:
{
gap: 0.1 * CHARACTER_SCALE,
layers: 1,
side: THREE.DoubleSide,
width: 1 * CHARACTER_SCALE,
widthSegments: 16,
}
where CHARACTER_SCALE is 0.9.
BoneMatrixWriter
Ƭ BoneMatrixWriter: (boneIndex: number, boneMatrix: THREE.Matrix4) => void
Type declaration
▸ (boneIndex, boneMatrix): void
Parameters
| Name | Type |
|---|---|
boneIndex | number |
boneMatrix | THREE.Matrix4 |
Returns
void
BoolNode
Ƭ BoolNode: Node<"bool">
BoundingBox
Ƭ BoundingBox: Object
Type declaration
| Name | Type |
|---|---|
min | Coords3 |
shape | Coords3 |
BoxSides
Ƭ BoxSides: "back" | "front" | "top" | "bottom" | "left" | "right" | "sides" | "all"
The sides of a canvas box.
"all" means all six sides, and "sides" means all the sides except the top and bottom.
BranchBlockLookup
Ƭ BranchBlockLookup: Object
What the branch functions need to know about the blocks around one.
Type declaration
| Name | Type |
|---|---|
getBlockById | (id: number) => { branch?: BranchShape | null ; branchShell?: boolean ; branchSockets?: BranchSocket[] } | null | undefined |
getRawVoxelAt | (vx: number, vy: number, vz: number) => number |
BranchKind
Ƭ BranchKind: "voxel" | "core" | "fin"
What a branch block's voxels are, beyond their joints. Mirrors
BranchKind: voxel is one voxel thick with its radius in its stage,
core is the core cell of a section wider than one voxel (its radius and
cut flag in WideBranchBits), fin a floor-seated fin as thick as
its stage says and as tall as its raw bits say.
BranchSeat
Ƭ BranchSeat: "centre" | "floor"
Where a branch's axis runs through its voxel. Mirrors BranchSeat in
crates/mesher/src/mesher/branch.rs: centre through the middle (a limb in
the air), floor along the middle of the voxel's floor, half sunk into
what lies below (a surface root, of which only the upper half exists).
BranchShape
Ƭ BranchShape: Object
Draws a block as a branch: a square-section tube of the radius each voxel
holds in its stage, joined to face neighbours of the same key at the
thinner of the two radii. Mirrors BranchShape in the mesher crate.
Type declaration
| Name | Type | Description |
|---|---|---|
endFace | string | - |
key | number | - |
kind? | BranchKind | - |
radiusMask | number | The contiguous run of stage bits holding the radius less one. |
seat? | BranchSeat | - |
sideFace | string | - |
texelsPerBlock | number | - |
BranchSocket
Ƭ BranchSocket: Object
A block that branches of key up to maxRadius run into.
Type declaration
| Name | Type |
|---|---|
key | number |
maxRadius | number |
BudgetedWorkOutcome
Ƭ BudgetedWorkOutcome: "worked" | "skipped" | "exhausted" | "yield"
CSSMeasurement
Ƭ CSSMeasurement: `${number}${string}`
A CSS measurement. E.g. "30px", "51em"
CameraPerspective
Ƭ CameraPerspective: "px" | "nx" | "py" | "ny" | "pz" | "nz" | "pxy" | "nxy" | "pxz" | "nxz" | "pyz" | "nyz" | "pxyz" | "nxyz"
CanvasBoxAtlasLayout
Ƭ CanvasBoxAtlasLayout: Object
Type declaration
| Name | Type |
|---|---|
height | number |
rects | Record<BoxFace, CanvasBoxAtlasRect> |
width | number |
CanvasBoxAtlasRect
Ƭ CanvasBoxAtlasRect: Object
One face's place in a merged layer's atlas, in atlas pixels.
Type declaration
| Name | Type | Description |
|---|---|---|
cellWidth | number | - |
cellX | number | The face's cell: the face plus the edge copies around it. |
height | number | - |
width | number | - |
x | number | The face canvas's top-left corner. |
y | number | - |
CanvasBoxOptions
Ƭ CanvasBoxOptions: Object
Parameters to create a canvas box.
Type declaration
| Name | Type | Description |
|---|---|---|
depth? | number | The depth of the box. Defaults to whatever width is. |
depthSegments? | number | The depth segments of the box, which is the number of pixels of the canvases along the depth. Defaults to whatever widthSegments is. |
gap | number | The gap between the layers of the box. Defaults to 0. |
height? | number | The height of the box. Defaults to whatever width is. |
heightSegments? | number | The height segments of the box, which is the number of pixels of the canvases along the height. Defaults to whatever widthSegments is. |
layers | number | The number of layers of this box. Defaults to 1. |
mergeFaces? | boolean | Draw each layer in one call instead of six. The six face canvases stay the paintable source (paint, materials and every face canvas work as before), and each paint is copied into one atlas texture the layer draws with through a single material, at the same texel density, filtering and shader hooks. Opt-in: a consumer that swaps a face material, or edits a face canvas without paint (then call BoxLayer.syncAtlas), needs the per-face path. Defaults to false. |
receiveShadows? | boolean | Whether this canvas box should receive shadows. Defaults to false. |
side | Side | The side of the box to render. Defaults to THREE.FrontSide. |
texelsPerBlock? | number | Texture pixels per world unit. When set, widthSegments, heightSegments and depthSegments are derived from the box's dimensions at this density (at least one texel each), so every face has square texels whatever the box's proportions. Without it a 0.3 x 0.14 x 0.06 box gets the same widthSegments along all three axes and its texture is squashed on every non-square face. Prefer this over hand-picked segment counts for anything that is not a cube. |
transparent? | boolean | Whether or not should this canvas box be rendered as transparent. Defaults to false. |
width | number | THe width of the box. Defaults to 1. |
widthSegments | number | The width segments of the box, which is the number of pixels of the canvases along the width. Defaults to 8. |
CharacterOptions
Ƭ CharacterOptions: Object
Parameters to create a character.
Type declaration
| Name | Type | Description |
|---|---|---|
arms? | Partial<ArmsOptions> | Parameters to create the character's arms. |
body? | Partial<BodyOptions> | Parameters to create the character's body. |
head? | Partial<HeadOptions> | Parameters to create the character's head. |
headLedBody? | HeadLedBodyOptions | Let the head lead the body (HeadLedBody): a standing body holds its heading while the look stays within reach of it, and a walking body faces where it travels, so a watcher turns its head before it turns its body. Off by default: head and body share every direction. |
idleArmSwing? | number | The speed at which the arms swing when the character is idle. Defaults to 0.06. |
isPaintedOnBuild? | boolean | Whether the boxes get the default colours (paintDefaultColors) as they are built. Defaults to true. A character that is repainted right away, or whose boxes only stand as the frame of a mesh drawn in their place, passes false: painting gives each face canvas a 2D context, and the browser finalizes contexts one by one when the character is collected (a crowd streaming in and out cost whole-second garbage collections). |
legs? | Partial<LegOptions> | Parameters to create the character's legs. |
mergeBoxFaces? | boolean | Draw each body part in one call instead of six (CanvasBoxOptions.mergeFaces). Painting is unchanged; a consumer that swaps or re-reads the parts' per-face materials as draw state needs the per-face path. Defaults to false. |
nameTagOptions? | Partial<NameTagOptions> | - |
positionLerp? | number | The lerp factor of the character's position change, expressed per frame at 60 FPS and renormalized to the real frame delta. Defaults to 0.7. |
receiveShadows? | boolean | Whether this character should receive shadows. Defaults to false. |
rotationLerp? | number | The lerp factor of the character's rotation change, expressed per frame at 60 FPS and renormalized to the real frame delta. Defaults to 0.2. |
shadowSelfBoundsMargin? | number | Slack in blocks around the body's bounding sphere (Character.shadowSelfBounds) for the shadow-map filter's reach and a frame of motion. Defaults to 0.1. |
swimEnterLerp? | number | Lerp factor when entering the swimming pose. Defaults to 0.12. |
swimExitLerp? | number | Lerp factor when exiting the swimming pose. Defaults to 0.05. |
swimmingSpeed? | number | The speed at which the arms stroke when the character is swimming. Defaults to 1.8. |
swingLerp? | number | The lerp factor of the swinging motion of the arms and legs. Defaults to 0.8. |
walkSway? | number | How much the body shifts its weight from foot to foot as it walks: a small roll over the planted foot and a dip as the feet pass their widest, read off the legs so it follows any gait. 1 is a natural walk, 0 turns it off. Defaults to 1. |
walkingSpeed? | number | The speed at which the arms swing when the character is moving. Defaults to 1.4. |
ChatHistoryUpdate
Ƭ ChatHistoryUpdate: ChatHistoryPage & { before?: number ; isJoin: boolean }
A page of the world's chat history as the chat hands it to onHistory.
isJoin marks the replay that came with a (re)join; the rest answer
requestHistory.
ChunkColumnState
Ƭ ChunkColumnState: Object
What the world knows of one chunk column, for isChunkColumnPending.
Type declaration
| Name | Type | Description |
|---|---|---|
isMeshOwed | boolean | A loaded chunk with a mesh job queued or running at some level. |
isReady | boolean | A loaded chunk whose data and light are in place. |
loadedForMs | number | Milliseconds since the chunk loaded; meaningless until it has. |
stage | "requested" | "processing" | "loaded" | null | The chunk pipeline's stage for the column; null when nothing is known of it. |
ChunkDataEventData
Ƭ ChunkDataEventData: Object
Type declaration
| Name | Type |
|---|---|
chunk | Chunk |
coords | Coords2 |
ChunkEventData
Ƭ ChunkEventData: Object
Type declaration
| Name | Type |
|---|---|
allMeshes | Map<number, Mesh[]> |
chunk | Chunk |
coords | Coords2 |
ChunkLitHookContext
Ƭ ChunkLitHookContext: Object
What a chunk lighting hook can read.
Type declaration
| Name | Type | Description |
|---|---|---|
albedo | Vec3Node | The albedo the face shades with (tints and weather applied). |
prepared | unknown | What the hooks' prepare returned, or undefined without one. |
sampled | Vec4Node | The atlas texel as sampled, before tints. |
sunTotal | Vec3Node | The sky and sun part of it, before block light. |
totalLight | Vec3Node | The light multiplier the face would be lit by. |
uniforms | ChunkShadingInputs | - |
v | ChunkVaryings | - |
ChunkMaterialKind
Ƭ ChunkMaterialKind: "opaque" | "cutout" | "seeThrough" | "fluid"
How a chunk material draws:
opaque: solid faces, the soft 5x5 shadow.cutout: the shared cutout buckets (leaves, plants, tufts), swaying by the per-vertex profile table.seeThrough: blended see-through blocks (glass, panes), the fast shadow, split around the water's depth bywaterDepthSide.fluid: water and other fluids: the surface branch and the fast shadow.
ChunkMaterialOptions
Ƭ ChunkMaterialOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
depthOnly? | boolean | The chunk vertex stage (waves and sway move the surface) over a fragment stage that writes nothing but depth: the water's depth passes. |
hooks? | ChunkShadingHooks | null | - |
kind | ChunkMaterialKind | - |
sway? | Partial<ChunkSwayConstants> | null | - |
ChunkMeshEventData
Ƭ ChunkMeshEventData: Object
Type declaration
| Name | Type |
|---|---|
chunk | Chunk |
coords | Coords2 |
level | number |
meshes | Mesh[] |
ChunkMeshUpdateEventData
Ƭ ChunkMeshUpdateEventData: ChunkMeshEventData & { reason: ChunkUpdateReason }
ChunkPrepareHookContext
Ƭ ChunkPrepareHookContext: Object
What a hook's fragment preparation can read.
Type declaration
| Name | Type |
|---|---|
uniforms | ChunkShadingInputs |
v | ChunkVaryings |
ChunkRegionArenasOptions
Ƭ ChunkRegionArenasOptions: Object
Tunables for the per-region BatchedMesh arenas that batch every
section of a batched chunk bucket into a few multi-draw calls per region.
Type declaration
| Name | Type | Description |
|---|---|---|
indexPerVertexRatio | number | Index capacity per vertex of capacity. Quad geometry uses six indices for every four vertices, hence the 1.5 default. |
pageVertexCapacity | number | Vertices a page of a region holds. A region is pages that never grow: one that fills opens another, so what one frame uploads when a region gains room is one page (about 9 MB at the default), never the whole region. Larger pages mean fewer draws, smaller ones smaller uploads; a section larger than a page gets a page of its own. |
regionSizeInChunks | number | The width and depth of a region, in chunk columns. Every section whose chunk falls inside the same region shares one BatchedMesh. |
slotSlack | number | Multiplier applied to a section's vertex/index count when reserving its arena slot, so small remeshes update in place instead of reallocating. |
ChunkRequestCandidate
Ƭ ChunkRequestCandidate: Object
Type declaration
| Name | Type |
|---|---|
cx | number |
cz | number |
distanceSquared | number |
isInView | boolean |
ChunkShadingHooks
Ƭ ChunkShadingHooks: Object
Game-side customization of a block's chunk shading: TSL nodes the chunk
graph calls at its stages. key names the customization for program
caching: two materials with the same key and kind share one program.
Type declaration
| Name | Type | Description |
|---|---|---|
displace? | (context: ChunkVertexHookContext) => Vec3Node | - |
key | string | - |
lit? | (context: ChunkLitHookContext) => Vec3Node | - |
prepare? | (context: ChunkPrepareHookContext) => unknown | - |
sampleUv? | (uv: Vec2Node, context: ChunkPrepareHookContext) => Vec2Node | - |
values? | Record<string, number | Vector2 | Vector3 | Vector4 | Color> | Per-material values the hooks read, by materialValue("hookValues.<name>", type): blocks whose hooks differ only in numbers share one key, and so one graph, with their numbers here. |
wave? | { amplitude: FloatNode ; speed: FloatNode } | Scale the fluid swell's amplitude and speed. |
wave.amplitude | FloatNode | - |
wave.speed | FloatNode | - |
ChunkShadingInputs
Ƭ ChunkShadingInputs: Object
Everything a world's chunk materials read alike.
Type declaration
| Name | Type | Description |
|---|---|---|
blended | BlendedPassInputs | null | The pass a world's blended layers are accumulating in, when it draws them order-independently (OrderIndependentTransparency.uniforms). With a separating surface in view every blended draw runs twice, once for each side of it, and the accumulation drops the fragments of the other side after they are shaded: a blended chunk fragment reads which side the pass keeps and lights only there (FragmentState.isKept). |
chunk | ChunkUniforms | - |
cones | LightConeUniforms | - |
id | number | Distinguishes worlds in program caches (their uniform nodes differ). |
lighting | ShaderLightingUniforms | - |
local | LocalLightInputs | - |
swayTable | ArrayUniform<Vector4, "vec4"> | - |
ChunkSharedPoolStats
Ƭ ChunkSharedPoolStats: Object
Type declaration
| Name | Type |
|---|---|
bytesAllocated | number |
isActive | boolean |
maxSlots | number |
usedSlots | number |
ChunkStage
Ƭ ChunkStage: { requestedAt: number ; sentAt: number | null ; stage: "requested" } | { arrivedAt: number | null ; data: ChunkProtocol ; receivedAt: number ; requestedAt: number | null ; sentAt: number | null ; source: "update" | "load" ; stage: "processing" } | { arrivedAt: number | null ; chunk: Chunk ; loadedAt: number ; receivedAt: number | null ; requestedAt: number | null ; sentAt: number | null ; stage: "loaded" }
ChunkSwayConstants
Ƭ ChunkSwayConstants: Object
A block's fixed sway (customShaders.sway), baked into its program.
Type declaration
| Name | Type | Description |
|---|---|---|
amplitude | number | - |
isCrossShaded | boolean | Cross-quad shading: fixed sun incidence, no face shade. |
rooted | boolean | - |
scale | number | - |
speed | number | - |
yScale | number | - |
ChunkUniforms
Ƭ ChunkUniforms: ReturnType<typeof createChunkUniforms> & SurfaceWeatherUniforms
ChunkUpdateEventData
Ƭ ChunkUpdateEventData: ChunkEventData & { reason: ChunkUpdateReason }
ChunkUpdateReason
Ƭ ChunkUpdateReason: "voxel" | "light"
ChunkVaryings
Ƭ ChunkVaryings: Object
What a chunk vertex hands its fragments (packed into nine slots).
Type declaration
| Name | Type | Description |
|---|---|---|
ao | FloatNode | - |
chunkReveal | FloatNode | The section's reveal from its arena's batching colour (1 otherwise). |
crossShading | FloatNode | 1 for a cross-quad plant (fixed sun incidence, no face shade). |
emissive | FloatNode | - |
fluidDepthBelow | FloatNode | - |
fluidFlow | Vec2Node | - |
fluidRestY | FloatNode | - |
isFluid | FloatNode | - |
isFluidPane | FloatNode | - |
isGreedy | FloatNode | - |
isWaterExposed | FloatNode | - |
light | Vec4Node | Voxel light (red, green, blue, sun), 0..1. |
lightTwist | Vec4Node | The bilinear correction's twist x head weight (quad-light.ts). |
mapUv | Vec2Node | - |
quadLightTail | FloatNode | - |
stageTint | Vec3Node | - |
viewDepth | FloatNode | - |
waterSurfaceY | FloatNode | - |
worldNormal | Vec3Node | - |
worldPosition | Vec3Node | - |
ChunkVertexHookContext
Ƭ ChunkVertexHookContext: Object
What a chunk vertex hook can read.
Type declaration
| Name | Type | Description |
|---|---|---|
blockPosition | Vec3Node | The geometry position in blocks (the mesher's section space). |
restWorld | Vec3Node | The vertex's world position before any displacement. |
runHeight | FloatNode | 0 at a vertical run's root, 1 at its tip. |
ClickOccasion
Ƭ ClickOccasion: "mousedown" | "mouseup"
The occasion a mouse click listener fires on. Mirrors InputOccasion for the keyboard: press and release are separate lanes, so a listener can tell a tap from a hold.
ClickType
Ƭ ClickType: "left" | "middle" | "right"
Three types of clicking for mouse input listening.
CloudsOptions
Ƭ CloudsOptions: Object
Parameters used to create a new Clouds instance.
Type declaration
| Name | Type | Description |
|---|---|---|
alpha | number | The opacity of the clouds. Defaults to 0.8. |
atmosphere? | SkyFogInputs | The world's atmosphere the deck hazes into: its sky fog, the sky's glow and the camera's water. The deck keeps its own fog range (it sits far above the ground fog) and fogs by horizontal distance only. Clear air without one. |
bottomShade | number | Brightness of the underside of a cloud block relative to its top, 0..1. Defaults to 0.7. |
cloudHeight | number | The y-height at which the clouds are generated. Defaults to 256. |
color | string | The color of the clouds. Defaults to #fff. |
count | number | The horizontal count of how many cloud blocks are along each edge of a cloud cell, count * count per cell. Defaults to 16. The whole cloud sheet therefore spans width * count * dimensions[0] blocks: it is width, not this, that adds cells. |
dimensions | Coords3 | The dimension of each cloud block. Defaults to [20, 20, 20]. |
endFadeFar? | FloatNode | - |
endFadeFarRatio | number | - |
endFadeNear? | FloatNode | The range the deck's far edge fades out over, in fog-scaled blocks (the world's fog range); from the deck's radius without one. |
endFadeNearRatio | number | - |
falloff | number | The noise falloff factor used to generate the clouds. Defaults to 0.9. |
height | number | The vertical count of how many cloud blocks are in a cloud cell. This is also used to determine the overall count of cloud blocks of all the clouds. Defaults to 3. |
lerpFactor | number | The lerp factor used to translate cloud blocks from their original position to their new position. Defaults to 0.3. |
noiseScale | number | The scale of the noise used to generate the clouds. Defaults to 0.08. |
octaves | number | The number of octaves used to generate the noise. Defaults to 5. |
seed | number | The seed used to generate the clouds. Defaults to -1, which draws a random seed at construction. A World replaces that with the server's world seed once INIT delivers it (Clouds.setSeed), so every client of one world grows the same deck; name a seed here to override. |
sideShade | number | Brightness of the vertical faces of a cloud block relative to its top, 0..1. Defaults to 0.86. |
speedFactor | number | The speed at which the clouds drift along -z, in blocks per second of the clock handed to Clouds.update. Defaults to 8. |
sunColor? | Vec3Node | The sun's colour and strength, for a volumetric deck's light. |
sunDirection? | Vec3Node | Toward the light the flanks shade by; straight up without one. |
sunTint | number | Extra brightness given to faces pointing at the sun, as a fraction. Defaults to 0.12. |
sunlightIntensity? | FloatNode | - |
threshold | number | The threshold at which noise values are considered to be "cloudy" and should generate a new cloud block. Defaults to 0.05. |
verticalNoiseScale? | number | The scale of the noise along the vertical axis. Defaults to noiseScale. Raise it above noiseScale for a shallow deck: a handful of layers span almost no noise at the horizontal scale, so every column fills to the same layer and the top comes out perfectly flat. |
width | number | The number of cloud cells along each axis of the grid, width * width in total. Defaults to 8. |
ColorNode
Ƭ ColorNode: Node<"color">
CommandInfo
Ƭ CommandInfo<T>: Object
Information about a command including its processor and documentation.
Type parameters
| Name | Type |
|---|---|
T | extends ZodObject<Record<string, ZodTypeAny>> = ZodObject<Record<string, never>> |
Type declaration
| Name | Type |
|---|---|
aliases | string[] |
args | T |
category? | string |
description | string |
flags | string[] |
isHidden | boolean |
isTabCompletePreFiltered | boolean |
process | (args: z.infer<T>) => void |
tabComplete | Partial<Record<string, (currentValue: string, context: TabCompleteContext) => string[]>> |
CommandOptions
Ƭ CommandOptions<T>: Object
Type parameters
| Name | Type |
|---|---|
T | extends ZodObject<Record<string, ZodTypeAny>> = ZodObject<Record<string, never>> |
Type declaration
| Name | Type |
|---|---|
aliases? | string[] |
args? | T |
category? | string |
description | string |
flags? | string[] |
isHidden? | boolean |
isTabCompletePreFiltered? | boolean |
tabComplete? | Partial<Record<keyof z.infer<T>, (currentValue: string, context: TabCompleteContext) => string[]>> |
Coords2
Ƭ Coords2: [number, number]
Coords3
Ƭ Coords3: [number, number, number]
CoupledPart
Ƭ CoupledPart: Object
One other voxel a coupled block is stored together with: where it sits
in this block's unrotated local frame, and the block id it must hold. Mirrors the
server CoupledPart.
Type declaration
| Name | Type |
|---|---|
id | number |
offset | Coords3 |
CreatureBodyOptions
Ƭ CreatureBodyOptions: ColorCanvasBoxOptions
CreatureHeadOptions
Ƭ CreatureHeadOptions: ColorCanvasBoxOptions & { faceColor: Color | string ; neckGap?: number }
CreatureLegOptions
Ƭ CreatureLegOptions: ColorCanvasBoxOptions & { betweenLegsGap?: number ; frontBackGap?: number }
CreatureOptions
Ƭ CreatureOptions: Object
Type declaration
| Name | Type |
|---|---|
body? | Partial<CreatureBodyOptions> |
head? | Partial<CreatureHeadOptions> |
idleLegSwing? | number |
legs? | Partial<CreatureLegOptions> |
nameTagOptions? | Partial<NameTagOptions> |
positionLerp? | number |
rotationLerp? | number |
swingLerp? | number |
walkingSpeed? | number |
CrustedFluidShaderOptions
Ƭ CrustedFluidShaderOptions: Object
A surface for a hot, viscous fluid: a dark cooled crust broken into plates over glowing seams, drifting along the fluid's own flow, built on the chunk lighting shader so it sits in the same world as every other block face.
- Flow. A top face drifts along the mesher's per-corner surface flow (the same field that bends the water's crests), a wall slides straight down, so a fall runs faster than the sheet feeding it, and an underside stays. Offsets restart every cycle behind a two-generation cross-over, the usual flow-map trick, so a varying flow field never shears the pattern for longer than one cycle. A still pool drifts a little on a heading drawn per generation.
- Crust. Each generation is a cellular field of plates. A plate forms hot when its generation rises, darkens as it cools, and heats up again and breaks as its generation fades, so the crust reforms continuously instead of cross-fading. A slow heat field makes some patches run hotter than others, so the cycle never pulses over a whole lake at once.
- Voxel grain. Everything is evaluated per texel on the block-aligned grid
(
texelsPerBlock, 16 by default), offsets advance in whole texels, and heat maps onto a six-entry palette in flat bands: pixel art, not a smooth noise render. A texel smaller than a screen pixel would alias into sparkle (there is no mip chain for a procedural pattern), so the pattern settles to its mean colour past a screen-footprint threshold. - Light. Crust (palette 0 and 1) is lit by the sun and sky like a solid face, over a small self-light so it stays readable in the dark; seams (palette 2 to 5) glow at their own colour. Block light is left out on purpose: the fluid's own emitted light would flood its crust to full brightness and flatten it. A per-direction face shade darkens walls and undersides so a fall reads as a solid column, and crust plates pick up a faint dome relief from the sun's heading.
Every value is a uniform, so a game can tune the look live on the returned
uniforms without a recompile. The hooks plug into World.customizeMaterial
for the fluid block, with kind seeThrough: the crust replaces the water's
surface optics, not the solid shading.
Type declaration
| Name | Type | Description |
|---|---|---|
bands? | [number, number, number, number] | Heat thresholds for the ember, seam, hot seam and core bands. |
crustSceneLight? | number | Crust response to the sun and sky light reaching the face. |
crustSelfLight? | number | Crust brightness without any light. |
cycleSeconds? | number | Seconds per crust generation. Must divide the shader clock's wrap period so the wrap lands on a generation boundary. |
faceShades? | { bottom: number ; sideX: number ; sideZ: number ; top: number } | Face shade for the +-X walls, +-Z walls, underside and top. |
faceShades.bottom | number | - |
faceShades.sideX | number | - |
faceShades.sideZ | number | - |
faceShades.top | number | - |
fallCrust? | number | Crust hold on a wall: below 1 a fall runs hotter than a pool. |
fallFlowSpeed? | number | Slide of a wall (a fall), in blocks per second. |
fallStretch? | number | Plate elongation down a wall (1 keeps them round). |
farFadeAnisotropy? | number | How much more a grazing view may squeeze the pattern along one screen axis than along the other before that axis alone settles it, like anisotropic texture filtering. 1 settles by the squeezed axis alone, which flattens a pool seen from its shore a few blocks out. |
farFadeTexelFootprint? | number | Texels per screen pixel past which detail starts settling to the mean colour; at 4x this it is settled. |
formTime? | number | Fraction of a generation a new plate takes to cool into crust. |
glowStrength? | number | Multiplier on the glowing bands. |
grain? | number | Per-texel heat jitter, which dithers the band edges. |
meanGlow? | number | Share of seam colour in the far mean colour. |
palette? | ColorRepresentation[] | Six colours from coldest to hottest: dark crust, lit crust, ember, seam, hot seam, seam core. The first two are lit; the rest glow. |
plateTexels? | number | Mean plate size, in texels. |
relief? | number | Plate dome relief on crust, 0 to 1: how far the plate's shaded half falls from the lit crust colour toward the dark one. |
seamWidth? | number | Seam half-width in plate units (distance to the plate border). |
surfaceFlowSpeed? | number | Drift of a running top face, in blocks per second. |
texelsPerBlock? | number | Texels per block of the grid the pattern snaps to. |
wave? | { amplitude: number ; speed: number } | Scale on the shared surface wave height and speed. |
wave.amplitude | number | - |
wave.speed | number | - |
zone? | { amplitude: number ; base: number ; scale: number ; speed: number } | Heat-field scale (per block), base, amplitude and speed (per second). |
zone.amplitude | number | - |
zone.base | number | - |
zone.scale | number | - |
zone.speed | number | - |
CrustedFluidSurface
Ƭ CrustedFluidSurface: Object
A crusted fluid's chunk shading and the uniforms that tune it live.
Type declaration
| Name | Type | Description |
|---|---|---|
hooks | ChunkShadingHooks | For World.customizeMaterial(block, null, { kind: "seeThrough", hooks }). |
uniforms | ReturnType<typeof crustUniforms> | - |
CullOptionsType
Ƭ CullOptionsType: Object
Type declaration
| Name | Type |
|---|---|
dimensions | Coords3 |
max | Coords3 |
min | Coords3 |
realMax | Coords3 |
realMin | Coords3 |
DebugOptions
Ƭ DebugOptions: Object
Type declaration
| Name | Type |
|---|---|
asyncPeriod? | number |
containerId? | string |
dataClass? | string |
dataStyles? | StyleDecl |
entriesClass? | string |
entriesStyles? | StyleDecl |
lineClass? | string |
lineStyles? | StyleDecl |
newLineStyles? | StyleDecl |
onByDefault? | boolean |
showVoxelize? | boolean |
stats? | boolean |
statsStyles? | StyleDecl |
DeepPartial
Ƭ DeepPartial<T>: { [P in keyof T]?: DeepPartial<T[P]> }
Type parameters
| Name |
|---|
T |
EntitiesOptions
Ƭ EntitiesOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
offscreenRadiusOf? | (entity: Entity) => number | undefined | - |
offscreenUpdateInterval | number | Frames between updates of an entity outside the camera's view and farther than a few blocks from it, staggered across entities (1: every entity every frame). An entity whose motion and pose follow the clock (damping and springs by elapsed time, poses from the shader clock) only coarsens what nobody sees. A herd posed every frame behind the player was most of a crowded frame. Needs the camera passed to Entities.update. |
physics | PhysicsEngine | null | The physics engine to keep entities' replicated colliders in, usually world.physics: the boxes a server's CollidersComp gives an entity (its colliders metadata), placed at its replicated position for as long as it is in range, so the player stops at them as at blocks. Without one, colliders are ignored. Example ts const entities = new VOXELIZE.Entities({ physics: world.physics }); |
releasedTickRetentionSeconds | number | Seconds a released entity's tick watermark is kept so a late, out-of-order UPDATE for it cannot resurrect it. Reordering on the unordered lane is a matter of seconds; past this the watermark is dropped, which is what keeps the map from growing by one entry for every creature that ever streamed past the player. |
stalenessTimeoutSeconds | number | Seconds an entity may go without any server message before it is considered lost and released. Covers dropped out-of-range and delete notifications so no entity can stay frozen forever. |
streamSilenceGraceSeconds | number | Seconds of total message silence after which staleness releases are suspended, so reconnects and tab suspensions do not purge live entities. |
EntityCollidersMetadata
Ƭ EntityCollidersMetadata: [number, number, number, number, number, number][]
Solid boxes the server gives an entity (its CollidersComp), relative to
its position: [minX, minY, minZ, maxX, maxY, maxZ] each.
EntityFaceShades
Ƭ EntityFaceShades: readonly [number, number, number, number, number, number]
EntityFogUniforms
Ƭ EntityFogUniforms: SkyFogInputs & { lightCones: LightConeUniforms }
The live world's atmosphere for entity materials: its sky fog, the camera's water, and the light cones. The same nodes the chunks read.
EntityLightSample
Ƭ EntityLightSample: Object
What one whole-object light sample knows about the point it stands on. Every field is in the chunk shader's own units so the composition below can follow the fragment program line for line.
Type declaration
| Name | Type | Description |
|---|---|---|
ambientColor | Color | - |
ambientFloor | number | max(uMinLightLevel + uBaseAmbient, 0). |
clusterB | number | - |
clusterG | number | - |
clusterR | number | Clustered local-light irradiance at the point (queryLocalLights), before any diffuse response. Unbounded: a lit floor's proxy carries the intensity of several emitters. |
downTransmit | Color | Downwelling transmittance of the water column above the point; white when dry. Scales every sun-path term exactly as downTransmit does. |
floodB | number | - |
floodG | number | - |
floodR | number | Flood block light per channel, level / maxLightLevel, 0..1. |
floodRemainder | number | Fraction of the flood term this point keeps once analytic lights have claimed their share (blockLightFloodRemainder), 0..1. 1 with local lights off. |
lightHue? | readonly [number, number, number] | Colour of the analytic lights around the point (LocalLightSample.lightHue): the flood borrows it for the channels it has run out of, like the chunk fragment. Absent or zero leaves the flood's own hue. |
shadowFactor | number | Sun visibility along the sun ray: 1 in the open, 1 - shadowStrength when a voxel blocks it — the whole-object stand-in for getShadow(). |
sunColor | Color | - |
sunExposure | number | sunlight / maxLightLevel, 0..1 — the shader's vLight.a. |
sunlightIntensity | number | - |
underwaterFill | Color | Scattered surface light filling the water around the point; black when dry. Added to the sun path like underwaterFill. |
EntityLightValue
Ƭ EntityLightValue: Object
The light an entity material is drawn in: a colour the CPU samples at its
owner (LightShined), changed in place. The material holds it
(userData.entityLight) and its graph reads it per draw.
Type declaration
| Name | Type |
|---|---|
value | Color |
EntityLivenessOptions
Ƭ EntityLivenessOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
stalenessTimeoutSeconds | number | Seconds an entity may go without any message before it is considered lost and released. The server keep-alive cadence is roughly one second, so this should comfortably exceed several missed keep-alives. |
streamSilenceGraceSeconds | number | Seconds of total message silence after which staleness judgment is suspended. A quiet stream means the connection itself is degraded (disconnect, tab suspension), not that individual entities were lost. |
EntityMetadata
Ƭ EntityMetadata: Object
Type declaration
| Name | Type |
|---|---|
colliders? | EntityCollidersMetadata |
rigidBody? | EntityRigidBodyMetadata |
EntityRigidBodyMetadata
Ƭ EntityRigidBodyMetadata: Object
Type declaration
| Name | Type |
|---|---|
fluidRatio | number |
isInFluid | boolean |
EntityShadowBody
Ƭ EntityShadowBody: Object
What one body's shadow reads besides the world's lighting. Every
material of the body holds the same record (setShadowBody), so one write
reaches all its parts, and the parts of every body share one graph.
Type declaration
| Name | Type | Description |
|---|---|---|
ignoresSelf | number | 1: nothing inside selfBounds shades any face (a placed viewmodel). |
minOccluderDepth | number | Shadow-map depth an occluder must lie past to shade (0: any). |
selfBounds | Vector4 | The body's bounding sphere in world space (centre, radius): the slope bias that keeps a sun-averted face out of its own body's shadow never reaches past it. Radius 0: no bounds. |
worldMatrix | Matrix4 | From where the body is drawn to where it is shaded, plus worldOffset. |
worldOffset | Vector3 | - |
EntityShadowBodyInputs
Ƭ EntityShadowBodyInputs: Object
A body's inputs as a shader reads them.
Type declaration
| Name | Type |
|---|---|
ignoresSelf | FloatNode |
minOccluderDepth | FloatNode |
selfBounds | Vec4Node |
worldMatrix | Mat4Node |
worldOffset | Vec3Node |
EntityShadowShading
Ƭ EntityShadowShading: ReturnType<typeof entityShadow>
EntityShadowUniforms
Ƭ EntityShadowUniforms: ReturnType<typeof createEntityShadowUniforms>
The world's lighting as an entity's shadow reads it: the sun, the cascades and their maps. What belongs to one body (its bounds, where it is drawn from) is its EntityShadowBody.
EntitySurfaceOptions
Ƭ EntitySurfaceOptions: Pick<InstancedSkinnedMaterialOptions, "useFaceUV" | "useVertexColor" | "atlasGridCols" | "atlasGridRows" | "partCount" | "emissiveFace">
Event
Ƭ Event: Object
A Voxelize event from the server.
Type declaration
| Name | Type | Description |
|---|---|---|
name | string | The name to identify the event. |
payload? | EventPayload | Additional information of the event. |
EventHandler
Ƭ EventHandler<TPayload>: (payload: TPayload) => void
The handler for an event sent from the Voxelize server.
Type parameters
| Name | Type |
|---|---|
TPayload | EventPayload |
Type declaration
▸ (payload): void
Parameters
| Name | Type |
|---|---|
payload | TPayload |
Returns
void
EventPayload
Ƭ EventPayload: JsonPrimitive | { [key: string]: EventPayload | undefined; } | EventPayload[]
FacePainter
Ƭ FacePainter: (ctx: CanvasRenderingContext2D, face: number, width: number, height: number) => void
Type declaration
▸ (ctx, face, width, height): void
Parameters
| Name | Type |
|---|---|
ctx | CanvasRenderingContext2D |
face | number |
width | number |
height | number |
Returns
void
FarBuiltTile
Ƭ FarBuiltTile: Object
A tile's meshes, built off the main thread.
Type declaration
| Name | Type |
|---|---|
buildMs | number |
land | FarMeshData | null |
sky | FarMeshData | null |
FarFaceLook
Ƭ FarFaceLook: Object
What one block face looks like from far away: the mean of its texels in
linear RGB, whether it takes a sample's regional tint (the face's
stageTintMask), and the texels themselves (RGBA8 sRGB, size square,
top row first) when the face has a texture.
Type declaration
| Name | Type |
|---|---|
color | readonly [number, number, number] |
isTinted | boolean |
pixels? | ArrayLike<number> |
size? | number |
FarFaceSide
Ƭ FarFaceSide: "top" | "side"
FarSeamShading
Ƭ FarSeamShading: ReturnType<typeof farSeam>
FarTerrainBudget
Ƭ FarTerrainBudget: Object
One client's request budget: a token bucket refilled by wall time.
Type declaration
| Name | Type |
|---|---|
burst | number |
maxTilesPerRequest | number |
tilesPerSecond | number |
FarTerrainDescriptor
Ƭ FarTerrainDescriptor: Object
What the server tells every client about its far terrain (INIT options).
Type declaration
| Name | Type | Description |
|---|---|---|
baseStep | number | Blocks between samples at the finest level; each level doubles it. |
budget? | FarTerrainBudget | What one client may ask for: the server refuses the rest of a request past it, and a refused tile is asked again only after the retry window. |
levels | number | Detail levels the server serves, 1..4. |
materials? | FarTerrainMaterial[] | What each material class is made of, indexed by a sample's class. Absent leaves the colours to the client's palette. |
seabedMaterial? | number | The class of the sea floor, which shallow far water shows through. |
skyMaterial? | number | The class floating land is painted with. |
tileSamples | number | Samples per tile side including the shared edge row (33 -> 32 cells). |
trees? | FarTerrainTree[] | The tree species tiles' canopy samples name, by index. |
waterSurface | number | The y of the far water plane. |
FarTerrainMaterial
Ƭ FarTerrainMaterial: Object
The blocks one material class is made of (registry block ids).
Type declaration
| Name | Type | Description |
|---|---|---|
covers? | { block: number ; share: number }[] | Blocks lying flat over part of the ground (snow, an outcrop), with the share of it each hides. |
deep? | number | The block below the side block (rock under soil); side when absent. |
side | number | The block under it: a wall shows top's side face on its highest block, this block's below for sideDepth blocks, and deep under that. |
sideDepth? | number | Blocks of side under the top block before deep; 3 when absent. |
top | number | The block whose upward face is the class's ground. |
FarTerrainOptions
Ƭ FarTerrainOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
budgetHeadroom | number | Tiles of the server's budget (descriptor.budget) never spent, so a request that arrives sooner after the last than it was sent is not refused for the difference. |
buildBudgetMs | number | Main-thread time one update may spend reading faces. |
buildMesh | (input: FarMeshInput) => Promise<FarBuiltTile | null> | null | Builds a tile's meshes; the default hands it to a worker. A test, or a host without workers, passes its own. |
castShadow | (input: FarShadowInput) => Promise<{ buildMs: number ; lines: Uint16Array } | null> | null | Casts the sun shadow lines (far-terrain-shadow), as half floats; the default hands it to the mesh workers. A host that builds its own meshes gets no shadows unless it passes this too. |
distance | number | How far past the viewer the layer reaches, in blocks; 0 turns it off. |
edgeBand | number | The outer share of the reach across which the layer thins into the haze, reaching it at the reach, so its edge never cuts against the sky. |
evictAfterMs | number | A tile no plan has drawn for this long leaves even under the cap: long enough that a trip away and back (a teleport home) finds the tiles it left still resident. |
faceLook | (block: number, side: FarFaceSide, stage: number) => FarFaceLook | null | null | What a block face looks like from afar, texels included (the world reads them off the atlas), or null while its texture is not painted yet. Used to paint the descriptor's materials. |
faceLookTimeoutMs | number | How long a face may stay unreadable before the layer paints it grey and says so, rather than never drawing. |
fadeMs | number | How long a tile takes to dissolve in or out when the detail changes. |
lod | FarLodOptions | How the layer chooses each tile's level of detail. |
maxBuildsInFlight | number | Tile builds in flight at once. |
maxResidentTiles | number | Tiles kept resident at most; the least recently drawn leave first. |
maxTilesPerRequest | number | Tiles one request may name; the server caps it too. |
palette | ArrayLike<number> | Linear RGB per class, flattened, for a server whose descriptor names no materials. A class past the end takes the last entry; an empty palette draws grey. |
pendingGuardRadius | number | Chunk columns nearer the viewer's than this, in chunks, show sky and fog while still on their way, whatever tile could stand in: right by the viewer, a coarse tile shows through the walls of a canyon. Further out any drawn tile stands in. 0 lets one stand in everywhere. The default 1 guards only the viewer's own column: a wider guard opened holes of fog right ahead of anyone flying faster than chunks load. |
requestIntervalMs | number | Least time between two requests. |
retryAfterMs | number | A requested tile that has not arrived in this long is asked again. |
seamBand | number | Blocks of the loaded area's outer edge that hand over to the far layer across a dithered band, up to half a chunk; 0 (the default) keeps the edge hard (see WorldOptions.farTerrainSeamBand). |
skySideColor | Color | string | number | - |
skyTopColor | Color | string | number | Colour of floating land's top and of its underside and walls, when the descriptor names no skyMaterial. |
waterColor | Color | string | number | The far water plane's colour. |
FarTerrainSharedUniforms
Ƭ FarTerrainSharedUniforms: SkyFogInputs & SurfaceWeatherUniforms & Pick<ChunkUniforms, "sunlightIntensity" | "minLightLevel" | "baseAmbient" | "faceShades" | "farCoverMask" | "farCover" | "farSeam"> & Pick<ShaderLightingUniforms, "sunDirection" | "sunColor" | "ambientColor" | "skyTopColor" | "skyMiddleColor" | "waterFresnelStrength" | "waterTint">
Everything the far layer reads from the world: the chunks' sky fog and daylight, their seam (written by the far layer), their weather, and the chunk water's sky and tint.
FarTerrainStats
Ƭ FarTerrainStats: Object
Counters a harness can read to prove the budget.
Type declaration
| Name | Type | Description |
|---|---|---|
batchPages | number | Pages of the batch the tile meshes are drawn from, one draw call each. |
buildsInFlight | number | Builds handed to the worker and not back yet. |
bytesReceived | number | - |
chunksHeld | number | Loaded chunks hidden while the far layer stands in for their unfinished meshes. |
distance | number | - |
faceLookMs | number | - |
facesMissing | number | - |
facesPending | number | - |
facesResolved | number | Block faces read for the descriptor's materials, those still waiting for their texture, those painted grey because they never became readable, and the main-thread ms the reads took. |
isActive | boolean | - |
lastBuildMs | number | Worker ms the last tile build took, and the highest since the peaks were reset. |
lastShadowMs | number | Worker ms the last cast of the far sun shadows took. |
lastUpdateMs | number | Main-thread ms the last update spent (planning, requests, mask). |
lastUploadMs | number | Main-thread ms the last built tile took to become a mesh, and the highest. |
levelCounts | number[] | Tiles drawn this frame at each level, finest first. |
maskRebuilds | number | Mask rebuilds. |
meshBytes | number | Bytes of vertex and index data across resident meshes. |
meshes | number | Tile meshes (land + sky) shown. |
peakBuildMs | number | - |
peakUpdateMs | number | Highest lastUpdateMs since the counters were last read. |
peakUploadMs | number | - |
pendingCovered | number | Chunk columns inside the render radius the last mask covered because they were still on their way (not loaded yet), inside the guard radius or under no drawn tile: 0 once everything inside has landed. |
pendingStoodIn | number | Chunk columns still on their way the last mask left to the far layer, under drawn tiles: the strip a flight brings inside the render radius, or the ground around a teleport's end, keeps the terrain it showed. |
quads | FarMeshCounts | Quads of the drawn land by what they are. |
rings | number | Detail levels drawn this frame. |
tilesBuilt | number | - |
tilesDrawn | number | Tiles drawn this frame, and those the detail rules want. |
tilesReceived | number | - |
tilesRejected | number | - |
tilesRequested | number | - |
tilesResident | number | - |
tilesWanted | number | - |
totalUpdateMs | number | Main-thread ms spent across every update, and how many there were. |
triangles | number | Triangles across every built tile mesh in the scene. |
updates | number | - |
FarTerrainTree
Ƭ FarTerrainTree: Object
A tree species: the block its crown is made of and the log it stands on, and the stage its crown's leaves mostly hold (absent: 0), which picks the look they wear where the block has stage faces.
Type declaration
| Name | Type |
|---|---|
leaves | number |
leavesStage? | number |
log | number |
FarTileData
Ƭ FarTileData: Object
One decoded tile. Samples are row-major by z then x.
Type declaration
| Name | Type | Description |
|---|---|---|
bytes | number | Bytes of the reply payload, for the wire budget. |
canopy | Uint8Array | null | The tree crowns over each sample's cell as (top, bottom, cover, kind): top and underside in blocks above the surface, the share of the cell covered (255 all), and the species index with bit 7 on the cell its trunk stands in; or null for none. |
colors | Uint8Array | Material class per sample. |
heights | Uint16Array | Top face y per sample. |
key | FarTileKey | - |
size | number | Samples per side. |
sky | Uint16Array | null | (top, bottom) per sample of floating land, 0 where none; or null. |
step | number | Blocks between samples. |
tints | Uint8Array | null | RGB tint per sample for the faces that take one, 128 meaning unchanged (a chunk's biomeTints encoding); or null for none. |
FarTileKey
Ƭ FarTileKey: Object
Type declaration
| Name | Type |
|---|---|
level | number |
tx | number |
tz | number |
FindSimilarOptions
Ƭ FindSimilarOptions: Object
Type declaration
| Name | Type |
|---|---|
maxSuggestions? | number |
FloatNode
Ƭ FloatNode: Node<"float">
Typed TSL node aliases, so shading signatures read like the GLSL they replace.
FluidQuery
Ƭ FluidQuery: (vx: number, vy: number, vz: number) => boolean
Type declaration
▸ (vx, vy, vz): boolean
Parameters
| Name | Type |
|---|---|
vx | number |
vy | number |
vz | number |
Returns
boolean
FormatSuggestionOptions
Ƭ FormatSuggestionOptions: Object
Type declaration
| Name | Type |
|---|---|
maxFallbackItems? | number |
GroundHeightSampler
Ƭ GroundHeightSampler: (x: number, y: number, z: number) => number | null
Type declaration
▸ (x, y, z): number | null
Parameters
| Name | Type |
|---|---|
x | number |
y | number |
z | number |
Returns
number | null
HeadLedBodyOptions
Ƭ HeadLedBodyOptions: Object
How far a look may stray from the body before the body turns, how fast it turns, and how close to the look a standing body settles.
Type declaration
| Name | Type | Description |
|---|---|---|
reach | number | Radians the look may sit off the body before a standing body turns. |
settle | number | Radians off the look a standing body's turn ends at. |
turnRate | number | Radians per second a standing body turns to catch its look up. |
HeadOptions
Ƭ HeadOptions: ColorCanvasBoxOptions & { faceColor: Color | string ; neckGap?: number }
HeapReader
Ƭ HeapReader: () => HeapSample | null
Reads the current heap, or returns null when the engine exposes no heap
numbers at all (every non-Chromium browser).
Type declaration
▸ (): HeapSample | null
Returns
HeapSample | null
HeapSample
Ƭ HeapSample: Object
A single reading of the renderer's JavaScript heap.
Type declaration
| Name | Type |
|---|---|
limitBytes | number |
usedBytes | number |
HiddenTabTicker
Ƭ HiddenTabTicker: (onTick: () => void, intervalMs: number) => () => void
Type declaration
▸ (onTick, intervalMs): () => void
Parameters
| Name | Type |
|---|---|
onTick | () => void |
intervalMs | number |
Returns
fn
▸ (): void
Returns
void
HitFlashProfile
Ƭ HitFlashProfile: Object
A flash's timing and strength.
Type declaration
| Name | Type |
|---|---|
fadeMs | number |
holdMs | number |
peak | number |
popAmount | number |
popMs | number |
IVec2Node
Ƭ IVec2Node: Node<"ivec2">
IVec3Node
Ƭ IVec3Node: Node<"ivec3">
ImageResolver
Ƭ ImageResolver: (name: string) => string
Type declaration
▸ (name): string
Parameters
| Name | Type |
|---|---|
name | string |
Returns
string
InputOccasion
Ƭ InputOccasion: "keydown" | "keypress" | "keyup"
The occasion that the input should be fired.
InputSpecifics
Ƭ InputSpecifics: Object
The specific options of the key to listen to.
Type declaration
| Name | Type | Description |
|---|---|---|
checkType? | "key" | "code" | The type of key to check for. Defaults to key. |
identifier? | string | A special identifier to tag this input with. This is useful for removing specific inputs from the input listener later on. |
occasion? | InputOccasion | The occasion that the input should be fired. Defaults to keydown. |
InstanceAttribute
Ƭ InstanceAttribute: THREE.BufferAttribute | THREE.InterleavedBufferAttribute
A per-instance attribute: its own buffer, or a view into a packed one.
IntNode
Ƭ IntNode: Node<"int">
IsolatedFaceEntry
Ƭ IsolatedFaceEntry<TMaterial>: Object
Type parameters
| Name |
|---|
TMaterial |
Type declaration
| Name | Type |
|---|---|
blockId | number |
createdAt | number |
faceName | string |
material | TMaterial |
state | SurfaceState |
voxel | Coords3 |
ItemRendererFactory
Ƭ ItemRendererFactory: (itemDef: ItemDef, world: World) => ItemRenderer
Type declaration
▸ (itemDef, world): ItemRenderer
Parameters
| Name | Type |
|---|---|
itemDef | ItemDef |
world | World |
Returns
ItemSlotsOptions
Ƭ ItemSlotsOptions: Object
Type declaration
| Name | Type |
|---|---|
activatedByDefault | boolean |
focusFirstByDefault | boolean |
horizontalCount | number |
perspective | CameraPerspective |
scrollable? | boolean |
slotClass | string |
slotFocusClass | string |
slotGap | number |
slotHeight | number |
slotHoverClass | string |
slotMargin | number |
slotPadding | number |
slotStyles | Partial<CSSStyleDeclaration> |
slotSubscriptClass | string |
slotSubscriptStyles | Partial<CSSStyleDeclaration> |
slotWidth | number |
verticalCount | number |
wrapperClass | string |
wrapperPadding | number |
wrapperStyles | Partial<CSSStyleDeclaration> |
zoom | number |
LazyWorkKind
Ƭ LazyWorkKind: string
LegOptions
Ƭ LegOptions: ColorCanvasBoxOptions & { betweenLegsGap?: number }
Parameters to create the legs of a character. Defaults to:
{
gap: 0.1 * CHARACTER_SCALE,
layers: 1,
side: THREE.DoubleSide,
width: 0.25 * CHARACTER_SCALE,
widthSegments: 3,
height: 0.25 * CHARACTER_SCALE,
heightSegments: 3,
depth: 0.25 * CHARACTER_SCALE,
depthSegments: 3,
betweenLegsGap: 0.2 * CHARACTER_SCALE,
}
where CHARACTER_SCALE is 0.9.
LightBatch
Ƭ LightBatch: Object
Type declaration
| Name | Type | Description |
|---|---|---|
batchId | number | - |
completedJobs | number | - |
jobs | LightJob[] | - |
pendingDispatch | LightJobGroup[] | Jobs of this batch that have not been handed to a worker yet, grouped by the chunk snapshot they share. Dispatch copies every chunk a group's light can reach, so groups wait here as cheap descriptors instead of as multi-megabyte copies. |
results | LightBatchResult[] | - |
totalJobs | number | - |
LightBatchResult
Ƭ LightBatchResult: Object
Type declaration
| Name | Type |
|---|---|
borderNeighbors | LightWorkerBorderNeighbor[] |
boundingBox | BoundingBox |
color | LightColor |
modifiedChunks | LightWorkerModifiedChunk[] |
LightColor
Ƭ LightColor: "RED" | "GREEN" | "BLUE" | "SUNLIGHT"
Sunlight or the color of torch light.
LightConeAuditEntry
Ƭ LightConeAuditEntry: Object
Type declaration
| Name | Type | Description |
|---|---|---|
material | string | - |
path | string | Names from the scene root down to the mesh. |
LightConeInput
Ƭ LightConeInput: Object
Type declaration
| Name | Type | Description |
|---|---|---|
angleDeg | number | Full outer cone angle in degrees. |
color | Color | - |
direction | Vector3 | - |
innerRatio | number | Inner (full-brightness) cone angle as a fraction of the outer angle. |
intensity | number | - |
origin | Vector3 | - |
range | number | - |
scatterStrength | number | - |
submersion | number | 0 above water to 1 submerged; drives extinction and beam glow. |
LightConeShading
Ƭ LightConeShading: ReturnType<typeof lightConeShading>
LightConeUniforms
Ƭ LightConeUniforms: ReturnType<typeof createLightConeUniforms>
The live cones, packed four vec4 per cone so they bind as one buffer:
(origin.xyz, submersion), (direction.xyz, 0), (colour x intensity, 0), (cosOuter, 1 / (cosInner - cosOuter), range, scatterStrength).
LightHandle
Ƭ LightHandle: number
Stable identity of a registered local light. Packed index:20 | generation:12;
0 is the invalid handle. Handles are plain numbers: storable, comparable,
and allocation-free.
LightJob
Ƭ LightJob: Object
Type declaration
| Name | Type |
|---|---|
batchId | number |
boundingBox | BoundingBox |
color | LightColor |
jobId | string |
lightOps | { floods: LightNode[] ; pendingRemovals?: LightNode[] ; removals: Coords3[] } |
lightOps.floods | LightNode[] |
lightOps.pendingRemovals? | LightNode[] |
lightOps.removals | Coords3[] |
retryCount | number |
LightJobGroup
Ƭ LightJobGroup: Object
The jobs of one batch that read the same chunks, sent to one worker over one snapshot.
A batch builds a job per colour, and an edit's four colours cover almost the same box: sent apart, each carried its own copy of every chunk in it, so a fire spreading through a forest copied the same sixty chunks four times a batch. The worker runs a group's jobs one after another on the one copy; a chunk's light word holds all four channels and each job's result is merged through its own colour mask, so they do not disturb each other.
Type declaration
| Name | Type | Description |
|---|---|---|
jobs | LightJob[] | - |
maxChunk | Coords2 | - |
minChunk | Coords2 | The chunk rectangle the snapshot is laid out on, inclusive. |
reachable | boolean[] | For each cell of the rectangle (x major, z minor, the order the snapshot is sent in), whether any seed's light can reach that chunk. Light travels at most maxLightLevel columns sideways from where it starts — the same bound a job's box is built from — so a chunk further than that from every seed is sent as absent, and the worker's floods stop at it. A box grown around seeds along a diagonal or a ring is mostly such chunks. |
reachableCount | number | - |
LightNode
Ƭ LightNode: Object
Type declaration
| Name | Type |
|---|---|
level | number |
voxel | Coords3 |
LightOperations
Ƭ LightOperations: Object
Type declaration
| Name | Type |
|---|---|
floods | { blue: LightNode[] ; green: LightNode[] ; red: LightNode[] ; sunlight: LightNode[] } |
floods.blue | LightNode[] |
floods.green | LightNode[] |
floods.red | LightNode[] |
floods.sunlight | LightNode[] |
hasOperations | boolean |
removals | { blue: Coords3[] ; green: Coords3[] ; red: Coords3[] ; sunlight: Coords3[] } |
removals.blue | Coords3[] |
removals.green | Coords3[] |
removals.red | Coords3[] |
removals.sunlight | Coords3[] |
LightQualityTier
Ƭ LightQualityTier: "ultra" | "high" | "medium" | "low" | "potato" | "off"
off is the user-facing disable: exactly the legacy flood-lit frame plus
emissive faces. potato is the identical-looking low-end fallback tier —
same rendering, kept separate so a device auto-downgrade and an explicit
user setting remain distinguishable.
LightShadowPolicy
Ƭ LightShadowPolicy: "none" | "voxelMask" | "shadowMap"
LightShape
Ƭ LightShape: "point" | "spot" | "capsule"
LightShinedOptions
Ƭ LightShinedOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
lerpFactor | number | The lerping factor of the brightness of each mesh. Defaults to 0.1. |
maxBrightness | number | Cap on the composed light multiplier, applied after tone mapping. The composition already runs through the chunk shader's ACES curve, which tops out near 1.03, so this only trims that asymptote: the materials under this effect are unlit and untonemapped, and any multiplier past 1 pushes their texture toward white. Defaults to 1. |
resampleDistance | number | Movement in blocks past which an object is resampled immediately instead of waiting out its interval: light data is voxel-grained, so a fast mover can cross into differently-lit voxels between scheduled samples. Defaults to 0.5. |
sampleIntervalFrames | number | Frames between fresh light samples for a stationary object. Each sample pays a sun raycast, a water-column walk, and a local-light query, while the sampled color is only ever consumed through the per-frame lerpFactor smoothing — a filter whose settling time is already several frames long, so a stationary object cannot display the difference between "sampled every frame" and "sampled every few frames". Objects are phase-staggered so the samples spread across frames instead of bunching. Defaults to 4. |
skipDetached | boolean | Skip a registered object whose ancestors do not end in a Scene. The entity manager releases an entity by detaching its root, so an object lit below that root (a character inside its entity) keeps a parent and would otherwise be traversed, resampled and lerped every frame although nothing draws it. Registering and removing in pairs is still the rule; this only bounds the cost of a missed remove. Needs every lit object to live under a real Scene (the world, an overlay scene), so it is off by default. Defaults to false. |
LightWorkerBorderNeighbor
Ƭ LightWorkerBorderNeighbor: Object
Type declaration
| Name | Type |
|---|---|
coords | Coords2 |
maxY | number |
minY | number |
LightWorkerModifiedChunk
Ƭ LightWorkerModifiedChunk: Object
Type declaration
| Name | Type |
|---|---|
coords | Coords2 |
lights | Uint32Array |
maxY | number |
minY | number |
LightWorkerResult
Ƭ LightWorkerResult: Object
Type declaration
| Name | Type | Description |
|---|---|---|
borderNeighbors | LightWorkerBorderNeighbor[] | Chunks the job did not write light into but whose meshes read a voxel it did: a light set in a chunk's border column shades the faces of the chunk next door (and the diagonal one at a corner). They carry no lights to merge — only the y-range to remesh. |
jobId | string | - |
modifiedChunks | LightWorkerModifiedChunk[] | - |
pendingFloods? | LightNode[] | Set when the worker hit its node budget mid-flood (e.g. a long open sunlight shaft under a floating island) and deferred the rest of the BFS rather than dropping it. The caller resubmits these as a follow-up job on the same bounding box so the region ends up fully lit instead of permanently partial. |
pendingRemovals? | LightNode[] | - |
LoadPhaseDrainScheduling
Ƭ LoadPhaseDrainScheduling: "task" | "frame"
LoadPhaseTaskPriority
Ƭ LoadPhaseTaskPriority: "background" | "user-visible"
LocalLightAirlightOptions
Ƭ LocalLightAirlightOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
coreRatio | number | Radius of a light's scattering core, as a fraction of its range: the glow is a broad haze thickening toward the source, never a hot point. |
dimmerMs | number | Time constant of the daylight/submersion dimmer, in ms. |
fadeMs | number | Fade in and out of the set, in ms (the grid's slot fade). |
fillCoreScale | number | Room fill core, as a multiple of the air core. |
fillFloodMask | number | 1: room fill lands only where the fragment's own flood reaches, so it never passes a wall; 0: unmasked (reaches past the flood, and leaks). |
fillRangeScale | number | Room fill reaches this multiple of a light's range. |
fillStrength | number | Room fill: share of a light's energy bounced onto unlit surfaces. |
hysteresis | number | An incumbent's score multiplier against challengers. |
lightsPerTier | Record<LightQualityTier, number> | Steady lights in the set, per quality tier (0 turns the layer off). |
maxAdded | number | Soft ceiling on the linear light the air adds to a pixel. |
openSkyShare | number | Share of the air glow kept under open sky at night. |
strength | number | In-scatter per block of air along a view ray. |
visibilityIntervalMs | number | One set member's line of sight is re-tested every this many ms. |
visibilityTolerance | number | A line-of-sight hit this close to a light (blocks) still counts as seeing it; the hit block holding the light always does. Kept under half a block: a light one wall away (a lamp in the next room) is hidden, however near the wall stands to it. |
LocalLightInputs
Ƭ LocalLightInputs: Object
Type declaration
| Name | Type |
|---|---|
air | LocalLightAirlight["uniforms"] |
grid | LightClusterGrid["uniforms"] |
shadow | { atlas: TextureInput ; params: Vec4Node & { value: unknown } ; params2: Vec4Node & { value: unknown } } |
shadow.atlas | TextureInput |
shadow.params | Vec4Node & { value: unknown } |
shadow.params2 | Vec4Node & { value: unknown } |
LocalLightShading
Ƭ LocalLightShading: ReturnType<typeof localLightShading>
LoneCubeCorner
Ƭ LoneCubeCorner: Object
Type declaration
| Name | Type |
|---|---|
ao | number |
light | number |
LoneCubeNeighborhood
Ƭ LoneCubeNeighborhood: Object
The cells round the cube, by offset from it. The cube's own cell is the cube: opaque and unlit, whatever the world holds there while it moves.
Type declaration
| Name | Type |
|---|---|
isOpaque | (dx: number, dy: number, dz: number) => boolean |
isWet | (dx: number, dy: number, dz: number) => boolean |
lights | (dx: number, dy: number, dz: number) => readonly [number, number, number, number] |
Mat3Node
Ƭ Mat3Node: Node<"mat3">
Mat4Node
Ƭ Mat4Node: Node<"mat4">
MemoryPressureOptions
Ƭ MemoryPressureOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
recoveryHeapRatio | number | Ratio at or below which pressure is considered relieved. Kept under MemoryPressureOptions.sheddingHeapRatio so the monitor has hysteresis instead of flapping around a single threshold. |
sampleIntervalMs | number | Milliseconds between heap samples. Zero or less disables the watchdog. |
shedCooldownMs | number | Minimum milliseconds between two shed actions while pressure persists. |
sheddingHeapRatio | number | usedJSHeapSize / jsHeapSizeLimit at or above which the renderer is treated as under pressure and load shedding begins. A worker that runs out of V8 heap takes the whole renderer process down with it, so this sits well below the limit rather than near it. |
sheddingSampleCount | number | Consecutive over-threshold samples required before shedding engages, so one transient spike (a large chunk batch mid-flight) does not throw away work that was about to be collected anyway. |
MemoryPressureStatus
Ƭ MemoryPressureStatus: Object
Type declaration
| Name | Type | Description |
|---|---|---|
heapLimitBytes | number | - |
heapRatio | number | - |
heapUsedBytes | number | - |
isHeapReadable | boolean | False on engines that expose no heap numbers; the monitor stays inert. |
isUnderPressure | boolean | - |
shedCount | number | - |
MemoryPressureVerdict
Ƭ MemoryPressureVerdict: "steady" | "shed" | "relieved"
What a sample concluded: shed asks the owner to drop load now,
relieved says pressure is over, steady means do nothing.
MeshApplyStats
Ƭ MeshApplyStats: Object
Cumulative cost of turning finished mesh results into live scene geometry
(buildChunkMesh), the main-thread half of every remesh. bytes counts the
geometry attribute payload applied, which is what the GPU upload scales
with. Cumulative since world init so a caller can difference two reads.
Type declaration
| Name | Type |
|---|---|
bytes | number |
count | number |
maxMs | number |
totalMs | number |
MeshResultType
Ƭ MeshResultType: Object
Type declaration
| Name | Type |
|---|---|
indices | Float32Array |
normals | Float32Array |
positions | Float32Array |
MeshTransferBenchmarkIteration
Ƭ MeshTransferBenchmarkIteration: Object
Type declaration
| Name | Type |
|---|---|
inputBytes | number |
outputBytes | number |
serializeMs | number |
totalMs | number |
workerMs | number |
MeshTransferBenchmarkModeResult
Ƭ MeshTransferBenchmarkModeResult: Object
Type declaration
| Name | Type |
|---|---|
avgSerializeMs | number |
avgTotalMs | number |
avgWorkerMs | number |
isSharedArrayBufferAvailable | boolean |
iterations | MeshTransferBenchmarkIteration[] |
measuredIterations | number |
p50TotalMs | number |
p95TotalMs | number |
strategy | WorkerTransferStrategy |
totalInputBytes | number |
totalOutputBytes | number |
warmupIterations | number |
MeshTransferBenchmarkOptions
Ƭ MeshTransferBenchmarkOptions: Object
Type declaration
| Name | Type |
|---|---|
cx | number |
cz | number |
level? | number |
measuredIterations? | number |
warmupIterations? | number |
MeshTransferBenchmarkResult
Ƭ MeshTransferBenchmarkResult: Object
Type declaration
| Name | Type |
|---|---|
cx | number |
cz | number |
level | number |
serializeSpeedup | number |
shared | MeshTransferBenchmarkModeResult |
speedup | number |
transfer | MeshTransferBenchmarkModeResult |
MeshTransferDispatch
Ƭ MeshTransferDispatch: (cx: number, cz: number, level: number) => Promise<{ geometries: object[] ; inputBytes: number ; outputBytes: number ; serializeMs: number ; workerMs: number } | null>
Type declaration
▸ (cx, cz, level): Promise<{ geometries: object[] ; inputBytes: number ; outputBytes: number ; serializeMs: number ; workerMs: number } | null>
Parameters
| Name | Type |
|---|---|
cx | number |
cz | number |
level | number |
Returns
Promise<{ geometries: object[] ; inputBytes: number ; outputBytes: number ; serializeMs: number ; workerMs: number } | null>
MeshWorkerTransferSample
Ƭ MeshWorkerTransferSample: Object
Type declaration
| Name | Type |
|---|---|
at | number |
inputBytes | number |
outputBytes | number |
serializeMs | number |
strategy | WorkerTransferStrategy |
totalMs | number |
workerMs | number |
MeshWorkerTransferStats
Ƭ MeshWorkerTransferStats: Object
Type declaration
| Name | Type |
|---|---|
jobCount | number |
recentSamples | MeshWorkerTransferSample[] |
strategy | WorkerTransferStrategy |
totalInputBytes | number |
totalOutputBytes | number |
totalSerializeMs | number |
totalWorkerMs | number |
MethodOutcome
Ƭ MethodOutcome: { kind: "ran" } | { handledBy: string[] | null ; kind: "unhandled" ; world: string } | { kind: "rejected" ; reason: string ; world: string } | { kind: "unanswered" ; waitedMs: number }
What the server did with one call, as Method.confirm found out.
ran: a handler ran it and did not turn it down. Whatever the handler does later (a spawn, a remesh) is not covered.unhandled: the world has no handler under that name.handledBylists the worlds on the same server that do, or isnullwhen the server keeps no index of them.rejected: the world's guard refused it, or its handler turned it down or panicked;reasonsays which and why.unanswered: the server did not answer within the wait (a dropped socket, a stalled world). The call may or may not have run.
NameTagDistance
Ƭ NameTagDistance: Object
How a name tag behaves with distance from the camera, in world units.
Type declaration
| Name | Type | Description |
|---|---|---|
fadeEnd | number | By this distance the tag has faded out completely, and past it the tag is not drawn at all, so a crowd of far tags costs no draw calls. Infinity keeps the tag at every distance. |
fadeStart | number | Up to this distance the tag shows at full opacity. |
seeThroughDistance | number | Within this distance the tag draws over everything, so it stays readable through thin cover and never flickers behind it. Past it the tag is depth tested like the world around it, so terrain between the camera and a far tag hides it instead of letting it show through. Infinity never depth tests. |
NameTagOptions
Ƭ NameTagOptions: Partial<NameTagDistance> & { backgroundColor?: string ; color?: string ; fontFace?: string ; fontSize?: number ; yOffset?: number }
Parameters to create a name tag.
NamedSkinnedPart
Ƭ NamedSkinnedPart<TBone>: Omit<SkinnedPart, "bone"> & { bone: TBone }
A SkinnedPart whose bone is named instead of numbered.
Type parameters
| Name | Type |
|---|---|
TBone | extends string |
NetworkConnectionOptions
Ƭ NetworkConnectionOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
getTicket? | () => Promise<string | null> | - |
reconnectTimeout? | number | Milliseconds between reconnection attempts after the socket drops. Defaults to DEFAULT_RECONNECT_TIMEOUT_MS; pass 0 to disable automatic reconnection. |
secret? | string | - |
ticket? | string | null | Signed session ticket proving who this client is (id, name, role, ...). Sent as ?ticket= on the socket upgrade and in the WebRTC offer. A server with session authentication derives the client id from it and ignores client_id; without one the client is admitted only where the server trusts client-chosen ids. |
useWebRTC? | boolean | - |
NetworkOptions
Ƭ NetworkOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
cacheRegistry | boolean | Keep the server's block registry (the bulk of every INIT) in Cache Storage or IndexedDB between joins and page loads. A JOIN then names the registry kept and the server leaves it out of the INIT while it still matches; see ./registry-cache. Servers that do not know the handshake ignore it, and a client without a kept registry gets the full INIT. |
decodeJobTimeoutMs | number | Milliseconds one decode job may take before its worker is presumed dead or hung. A worker the renderer kills (out of memory, most often) dies without an error event, and its job would never settle: the page stayed connected and joined while every packet after it waited forever. Past this the worker is replaced and the job's packets are decoded again. Must be positive: decoded messages are delivered in the order their packets arrived, so a job that never settled would hold back every message behind it. |
joinAnswerTimeout | number | Milliseconds a join request handed to an open socket may go unanswered before it is sent again, loudly. The server answers every such request with an INIT, an ERROR or a close, and a repeated JOIN makes it replay the whole INIT, which the page then applies a second time. A loaded server can take well over NetworkOptions.joinRetryTimeout to answer, so this one only bounds a server that never does. |
joinRetryTimeout | number | Milliseconds a (re)join handshake may await its INIT before a join request that never reached an open socket is sent again. |
maxBacklogFactor | number | - |
maxDecodeAttempts | number | Times one job's packets are decoded before they are given up on, loudly. Bounds a packet that kills or hangs every worker it is handed to. |
maxDecodeWorkers | number | Decode workers to run, at most one per core. Every worker is a V8 isolate, and every isolate in a renderer (the page and all of its workers) draws its heap from one shared pointer-compression cage of about 4 GB, whatever heap limit each isolate reports; the renderer dies when their sum reaches it. A decode worker that has been busy keeps tens of megabytes of young generation committed for good, and decoding (LZ4 and protobuf) is light enough that a few workers keep up with any stream, so one per core spent the shared budget for nothing. |
maxPacketsPerDecodeJob | number | Packets one decode job carries. A tick's backlog goes to as few workers as this allows rather than being spread over all of them, so the workers a light stream does not need stay idle and small, and no single job's decoded messages can balloon a worker's heap. What a tick does not hand out waits in the packet queue as raw buffers, outside the V8 heap. |
maxPacketsPerTick | number | - |
maxPendingCommandPackets | number | Upper bound on command packets (see COMMAND_PACKET_TYPES) held for retry after a send raced a closing socket. Beyond it the oldest are dropped loudly and counted in Network.droppedCommandCount: bounded loss beats unbounded buffering, but a command must never vanish in silence. |
maxQueuedPackets | number | Upper bound on buffered inbound packets. Beyond it the oldest packets are dropped, loudly and counted in Network.droppedPacketCount: the interest/keep-alive protocol re-converges on fresh state, so bounded loss beats unbounded memory growth when processing stalls. |
registryCacheWaitMs | number | Milliseconds an INIT that left the registry out may wait for the kept copy to finish loading from storage. The JOIN itself never waits: it names the registry storage says it keeps, and the read (started when the network is created, or with a later JOIN) has normally landed by the time the INIT does. Past this the client joins again, on a fresh socket and without a digest, and gets the full registry. |
OrderIndependentSeparator
Ƭ OrderIndependentSeparator: Object
A surface whose far side is only ever seen through it, the way water
refracts what lies beyond it: per pixel, every blended fragment behind
its nearest face (by depth) is composited into the scene first, so the
surface can read it, and the face itself and everything in front of it
accumulate afterwards. The surface needs no rule of its own: its nearest
face lies at that depth, and any face of it farther back is behind it
like anything else, so water seen through water is refracted too.
Type declaration
| Name | Type | Description |
|---|---|---|
bias | number | How far behind that face, in blocks, a fragment has to be to count as behind it. |
depth | () => Texture | null | - |
OrderIndependentSkipReason
Ƭ OrderIndependentSkipReason: "canvas" | "no-depth-texture" | "multisampled" | "not-perspective" | "special-depth"
Why a render of the scene drew its blended layers in list order.
OrderIndependentStats
Ƭ OrderIndependentStats: Object
Type declaration
| Name | Type | Description |
|---|---|---|
adopted | number | Materials found able to accumulate. |
drawnAfter | string[] | Blended materials that cannot accumulate and draw over the composite. |
opened | number | Renders that accumulated their blended layers. |
skipped | Partial<Record<OrderIndependentSkipReason, number>> | Renders with the armed camera that could not, by reason. |
OrderIndependentTransparencyOptions
Ƭ OrderIndependentTransparencyOptions: Object
Order-independent transparency (weighted blended): every blended surface
the world draws — glass, water, cutouts' translucent texels, particles,
sprites, effects — accumulates into one target in any order and is
composited once over the scene, so no draw order can paint one layer over
another that is in front of it. See World.prepareTransparency.
Type declaration
| Name | Type | Description |
|---|---|---|
solidTexelAlpha | number | The texel alpha at or above which a see-through block's texel is solid: it draws with the cutouts and writes depth instead of blending. |
weights | OrderIndependentWeights | - |
OrderIndependentWeights
Ƭ OrderIndependentWeights: Object
The depth weight of a blended fragment, by its distance from the camera
in blocks: scale / (1 + d / nearDistance + (d / farDistance)⁶),
clamped to [min, max]. Layers within nearDistance weigh about the
same, and past it a layer twice as far weighs about half, so the alpha
in the weight (more opaque layers count more) decides most of a mix, as
compositing back to front would: a clear pane at the camera does not wash
out the coloured glass behind it. Past farDistance the weight falls off
fast; the clamp keeps the half-float sums in range.
Type declaration
| Name | Type |
|---|---|
farDistance | number |
max | number |
min | number |
nearDistance | number |
scale | number |
OverdueChunkRequest
Ƭ OverdueChunkRequest: ChunkRequestHistory & { name: string }
ParsedRegistry
Ƭ ParsedRegistry: Object
Type declaration
| Name | Type |
|---|---|
blocksById | [number, any][] |
blocksByName | [string, any][] |
idMap | [number, string][] |
nameMap | [string, number][] |
PartialRecord
Ƭ PartialRecord<K, T>: { [P in K]?: T }
Type parameters
| Name | Type |
|---|---|
K | extends keyof any |
T | T |
PeersOptions
Ƭ PeersOptions: Object
Parameters to customize the peers manager.
Type declaration
| Name | Type | Description |
|---|---|---|
autoAddToSelf | boolean | - |
countSelf | boolean | Whether or not should the client themselves be counted as "updated". In other words, whether or not should the update function be called on the client's own data. Defaults to false. |
updateChildren | boolean | Whether or not should the peers manager automatically call update on any children mesh. Defaults to true. |
PerspectiveOptions
Ƭ PerspectiveOptions: Object
Parameters to create a new Perspective instance.
Type declaration
| Name | Type | Description |
|---|---|---|
blockMargin | number | The margin between the camera and any block that the camera is colliding with. This prevents the camera from clipping into blocks. Defaults to 0.3. |
ignoreFluids | boolean | Whether or not should the camera ignore fluid block collisions. Defaults to true. |
ignoreSeeThrough | boolean | Whether or not should the camera ignore see-through block collisions. Defaults to true. |
maxDistance | number | The maximum distance the camera can go from the player's center. Defaults to 5. |
swimDistanceBonus | number | Extra camera distance while swimming in second/third person. Defaults to 3. |
zoomInLerp | number | Per-frame factor (at 60 fps) the camera closes toward a nearer obstruction. High, so a wall swinging in behind the player never shows the inside of a block. Defaults to 0.85. |
zoomOutDelay | number | Seconds the view must stay clear before the camera starts easing back out. A gap in a fence or canopy shorter than this never moves the camera at all, so a row of posts behind the player reads as one obstruction rather than a pump per post. Defaults to 0.25. |
zoomOutLerp | number | Per-frame factor (at 60 fps) the camera eases back out once an obstruction clears. Low on purpose: the voxel raycast behind the player flips between hit and miss in discrete steps as they walk past posts, trunks, and canopy gaps, and a symmetric fast lerp turned every flip into a visible zoom pump. Snapping in and gliding out merges those into one dip. Defaults to 0.12. |
PortraitOptions
Ƭ PortraitOptions: Object
Parameters to create a portrait with.
Type declaration
| Name | Type | Description |
|---|---|---|
height | number | The height of the portrait canvas. Defaults to 100 pixels. |
lightRotationOffset | number | The rotation around the y axis about the camera. This is used to calculate the position of the light. Defaults to -Math.PI / 8. |
perspective | CameraPerspective | The position of where the camera should be looking at. Defaults to pxyz, which means that the camera will be looking at the center of the object from the positive x, y, and z axis scaled by the zoom. |
renderOnce | boolean | Whether or not should this portrait only render once. Defaults to false. |
width | number | The width of the portrait canvas. Defaults to 100 pixels. |
zoom | number | The arbitrary zoom from the camera to the object. This is used to calculate the zoom of the camera. Defaults to 1. |
ProcessedUpdate
Ƭ ProcessedUpdate: Object
Type declaration
| Name | Type |
|---|---|
newBlock | Block |
newId | number |
newRotation | BlockRotation |
oldBlock | Block |
oldId | number |
oldRotation | BlockRotation |
oldStage | number |
stage | number |
voxel | Coords3 |
ProtocolWS
Ƭ ProtocolWS: WebSocket & { sendEvent: (event: any) => boolean }
RegionArenaStats
Ƭ RegionArenaStats: Object
Region arenas' regions, pages and sections, in all and per bucket.
Type declaration
| Name | Type |
|---|---|
buckets | Record<string, { pages: number ; regions: number ; sections: number }> |
pages | number |
regions | number |
sections | number |
RelayedEventHandler
Ƭ RelayedEventHandler<TPayload>: (payload: TPayload, meta: RelayedEventMeta) => void
Type parameters
| Name | Type |
|---|---|
TPayload | EventPayload |
Type declaration
▸ (payload, meta): void
Parameters
| Name | Type |
|---|---|
payload | TPayload |
meta | RelayedEventMeta |
Returns
void
RelayedEventMeta
Ƭ RelayedEventMeta: Object
Who a relayed effect came from and where it happens, stamped by the server.
Type declaration
| Name | Type | Description |
|---|---|---|
position? | [number, number, number] | - |
senderId | string | The sender's client id, set by the server: a payload cannot forge it. |
RigidControlState
Ƭ RigidControlState: Object
The state of which a Voxelize Controls is in.
Type declaration
| Name | Type | Description |
|---|---|---|
crouching | boolean | Whether if the client is attempting to crouch, if the crouch key is pressed. Defaults to false. |
currentJumpTime | number | Seconds left of the current jump's push, while its key is held. Defaults to 0. |
heading | number | In radians, the heading y-rotation of the client. Defaults to 0. |
isJumping | boolean | Whether or not is the client jumping, in the air. Defaults to false. |
jumpCount | number | How many times has the client jumped. Defaults to 0. |
jumping | boolean | Whether if the client is attempting to jump, if the jump key is pressed. Defaults to false. |
running | boolean | Whether if the client is running. Defaults to false. |
sprinting | boolean | Whether if the client is attempting to sprint, if the sprint key is pressed. Defaults to false. |
RigidControlsOptions
Ƭ RigidControlsOptions: Object
Parameters to initialize the Voxelize Controls.
Type declaration
| Name | Type | Description |
|---|---|---|
airJumps | number | How many times can a client jump in the air. Defaults to 0. |
airMoveMult | number | The factor applied to the movements of the client in air, such as while half-jump. Defaults to 0.7. |
alwaysSprint | boolean | Sprint factor would be on always. Defaults to false. |
autoJump | boolean | Jump automatically at a ledge too tall to step onto but low enough for a jump to clear, the way voxel games with an auto-jump option do. The jump is a real one through the normal jump path, started ahead of the ledge so the feet pass its top on the way up instead of bumping the face first. Off while crouching, swimming, climbing, flying, or walking backwards. Defaults to true. |
autoJumpCooldown | number | Milliseconds after an automatic jump before another may fire. Defaults to 100. |
autoJumpFacingDot | number | Cosine between the look direction and the travel direction below which auto-jump stays off, so walking backwards into a ledge never hops onto it blind. Pure strafing (cosine 0) still hops. Defaults to -0.15. |
autoJumpLookahead | number | Seconds of travel scanned ahead for a jumpable ledge. The jump fires as soon as a ledge enters this window, so it must exceed the time the jump takes to rise past the tallest auto-jumpable ledge (about 0.24 s for 1.2 blocks at the default impulse and gravity). Defaults to 0.3. |
autoJumpMaxHeight | number | Tallest rise auto-jump attempts, in blocks. Kept under what the jump actually clears (the apex from jumpImpulse against gravity, 1.29 at the defaults) so the landing has margin. Defaults to 1.2. |
autoJumpMinLookahead | number | Minimum scan distance in blocks, so a client standing against a ledge still hops the moment it starts walking into it. Defaults to 0.2. |
bodyDepth | number | The depth of the client's avatar. Defaults to 0.8 blocks. |
bodyHeight | number | The height of the client's avatar. Defaults to 1.55 blocks. |
bodyWidth | number | The width of the client's avatar. Defaults to 0.8 blocks. |
crouchBodyHeight | number | The height of the client's avatar when crouching. Defaults to bodyHeight * 0.83. |
crouchFactor | number | The factor to the movement speed when crouch is applied. Defaults to 0.6. |
eyeHeight | number | The ratio to bodyHeight at which the camera is placed from the ground. Defaults at 0.9193548387096774. |
fluidExitClearance | number | A body treading fluid with its head out that presses into a bank no taller than fluidExitMaxHeight over the surface climbs out: launched so its feet peak this far over the bank's top. 0 turns the climb off. Defaults to 0.3. |
fluidExitMaxHeight | number | Tallest bank, over a fluid's surface, a body treading it climbs out onto. Defaults to 1.2. |
fluidPushForce | number | The strongest upward impulse a held jump key gives in fluid: what one frame at referenceFrameRate may add, scaled by frame time at any other rate. Treading water spends it swimming up at the swim speed and holding the body at fluidTreadEyeHeight. Defaults to 0.3. |
fluidTreadEyeHeight | number | Height of the eyes over a fluid's surface where a body treading it, its jump key held, comes to rest. Defaults to 0.25. |
flyClimbSpeedPenalty | number | Fraction of fly speed lost at a straight-up climb when pitch steering is active, trading speed for altitude. Defaults to 0. |
flyDiveSpeedBoost | number | Extra speed multiplier granted at a straight-down dive when pitch steering is active. 1.2 means a vertical dive flies at 2.2x the base fly speed. Scales quadratically with dive steepness. Defaults to 0. |
flyForce | number | The level of force at which a client flies at. Defaults to 80. |
flyImpulse | number | The vertical impulse a held fly-up or fly-down key gives: what one frame at referenceFrameRate adds, scaled by frame time at any other rate. Defaults to 2.5. |
flyInertia | number | The inertia of a client when they're flying. Defaults to 6. |
flyPitchSteering | number | How much the camera pitch steers fly movement, from 0 (movement stays horizontal) to 1 (movement follows the full look vector, elytra-style). Defaults to 0. |
flySpeed | number | The level of speed at which a client flies at. Defaults to 40. |
initialDirection | Coords3 | - |
initialPosition | Coords3 | Initial position of the client. Defaults to (0, 80, 10). |
jumpForce | number | The upward force a held jump key adds for the first jumpTime of a jump, so holding it lifts the jump a little higher than the impulse alone. Defaults to 3.5. |
jumpImpulse | number | The level of impulse at which the client jumps upwards. Defaults to 8. |
jumpTime | number | How long, in milliseconds, a held jump key keeps pushing (jumpForce) after the jump starts. Defaults to 50ms. |
maxPolarAngle | number | Maximum polar angle that camera can look up to. Defaults to Math.PI * 0.99 |
maxSpeed | number | The maximum level of speed of a client. Default is 6 . |
minPolarAngle | number | Minimum polar angle that camera can look down to. Defaults to Math.PI * 0.01. |
moveForce | number | The level of force of which the client can move at. Default is 30. |
positionLerp | number | The interpolation factor of the client's position. Defaults to 1.0. |
referenceFrameRate | number | The frame rate, in frames per second, that the per-frame tunables (flyImpulse, fluidPushForce, swimAABBLerp, the ladder's easing) were tuned at. Each frame applies them scaled by how many of these frames it lasted, so a held key climbs, swims or flies the same distance per second at any frame rate, and exactly as tuned at this one. Defaults to 120. |
responsiveness | number | How fast, per second, a client's velocity settles onto the one its input asks for, once it is close enough that the movement force no longer caps the change. Default is 240. |
restoreFootSnapEpsilon | number | - |
rotationLerp | number | The interpolation factor of the client's rotation. Defaults to 0.9. |
runningFriction | number | Default running friction of a client. Defaults to 0.1. |
sensitivity | number | The mouse sensitivity. Defaults to 100. |
sprintFactor | number | The factor to the movement speed when sprint is applied. Defaults to 1.4. |
standingFriction | number | Default standing friction of a client. Defaults to 4. |
statusSpeedFactor | number | Server-provided temporary effects; applies only to ordinary ground walking. |
statusSwimFactor | number | Server-provided temporary effects; applies only to swimming. |
stepEyeClearance | number | Height, in blocks, the eye always keeps above the top of a step it just climbed while it eases up after the body. Caps how far the eye may trail when a staircase stacks steps faster than they settle, so the camera never sinks into the tread it stands on. Defaults to 0.25. |
stepGrazeRatio | number | Along-face to into-face motion ratio above which contact with a ledge is a graze that slides along it rather than an approach that steps onto it. 4 ignores approaches shallower than ~14°, so brushing a block while walking past does not pop the client onto it. 0 steps on any blocked contact. Defaults to 4. |
stepHeight | number | How tall a client can step up. Defaults to 0.5. |
stepSmoothTime | number | How long, in milliseconds, the eye takes to close 95% of a one-block auto-step; smaller steps settle proportionally faster (a half slab in half the time). The body itself climbs the step in a single physics tick; this eases only the eye (and what follows it: the streamed position, the third-person character) up after it on a critically damped spring, so the rise is an S-curve with no pop and no overshoot at any frame rate. 0 snaps the eye with the body. Defaults to 250. |
swimAABBLerp | number | Lerp factor for the swim hitbox height transition, per frame at referenceFrameRate. Defaults to 0.08. |
swimBodyHeight | number | Collision height while swimming. Defaults to 0.4. |
swimForce | number | Force applied while swimming. Defaults to 28. |
swimFriction | number | Friction while swimming and moving. Defaults to 0.05. |
swimIdleStandDelay | number | Time without swim movement input before returning to an upright pose. Defaults to 3000. |
swimRestoreGraceFrames | number | Frames to keep the swim AABB after restoring a saved swimming session. Defaults to 2. |
swimSpeed | number | Target speed while swimming. Defaults to 4.5. |
swimSubmersionRatio | number | Minimum ratio of the body submerged before swimming mechanics activate. Defaults to 0.95. |
RosterPool
Ƭ RosterPool: THREE.Object3D & { dispose: () => void }
RosterUpdate
Ƭ RosterUpdate: (deltaTime: number, renderer: THREE.Renderer) => void
Type declaration
▸ (deltaTime, renderer): void
Parameters
| Name | Type |
|---|---|
deltaTime | number |
renderer | THREE.Renderer |
Returns
void
ScalarInput
Ƭ ScalarInput: UniformNode<number>
SectionExtentOptions
Ƭ SectionExtentOptions: Object
Type declaration
| Name | Type |
|---|---|
chunkSize | number |
maxHeight | number |
subChunks | number |
SectionVisibilityGraphOptions
Ƭ SectionVisibilityGraphOptions: Object
Type declaration
| Name | Type |
|---|---|
chunkSize | number |
maxHeight | number |
subChunks | number |
SerializedBlockRotation
Ƭ SerializedBlockRotation: { [K in "PX" | "NX" | "PY" | "NY" | "PZ" | "NZ"]?: number }
The wire shape of a block rotation inside server-authored block rules: the
Rust BlockRotation enum serializes as a single-key object mapping the axis
to the y-rotation angle in radians, e.g. { "PX": 0 }.
SerializedRegistry
Ƭ SerializedRegistry: string | SerializedRegistryPayload
The wire form of a registry: a JSON string (what serialize returns) or,
for tests and in-process callers, the already-parsed payload.
SerializedRegistryPayload
Ƭ SerializedRegistryPayload: Object
Type declaration
| Name | Type |
|---|---|
blocksById | [number, any][] |
idMap | [number, string][] |
nameMap | [string, number][] |
version | number |
ShaderLightingUniforms
Ƭ ShaderLightingUniforms: ReturnType<typeof createShaderLightingUniforms>
ShadowInvalidationCause
Ƭ ShadowInvalidationCause: "blockEdit" | "chunkMeshed" | "eviction" | "tierChange" | "manualRegion" | "lightMoved" | "lightRotated" | "incompleteDraw"
SkyFogInputs
Ƭ SkyFogInputs: Pick<ChunkUniforms, "fogColor" | "fogNear" | "fogFar" | "fogHeightOrigin" | "fogHeightDensity" | "fogVerticalBlend" | "aerialHaze" | "skyFogTopColor" | "skyFogMiddleColor" | "skyFogBottomColor" | "skyFogOffset" | "skyFogVoidOffset" | "skyFogExponent" | "skyFogExponent2" | "skyFogDimension" | "skyFogStrength" | "skyGlowSunDirection" | "skyGlowColor" | "skySunHaloColor" | "skyMoonHaloColor" | "skySunDiscColor" | "skyMoonDiscColor" | "skyDiscRadii" | "skyMoonFace" | "cameraSubmersion" | "cameraWaterPlaneY" | "underwaterAmbient" | "underwaterViewScale"> & Pick<ShaderLightingUniforms, "directSunlight">
The inputs every fogged surface reads: the chunk set and the beam.
SkyFogShading
Ƭ SkyFogShading: ReturnType<typeof skyFog>
SkyGlowInputs
Ƭ SkyGlowInputs: Pick<SkyFogInputs, "skyGlowSunDirection" | "skyGlowColor" | "skySunHaloColor" | "skyMoonHaloColor" | "skySunDiscColor" | "skyMoonDiscColor" | "skyDiscRadii" | "skyMoonFace" | "directSunlight">
The sky's own light: its glow toward the sun and moon, and their discs.
SkyGlowUniforms
Ƭ SkyGlowUniforms: Object
The sky's own light, drawn by the dome and by every fogged surface from
one set of uniform nodes (skyGlow), so the haze in front of a sunset
wears exactly the light of the sky behind it. Colours are linear and
already scaled by their strength; all black, the default, adds nothing.
The world keeps sunDirection on the drawn disc each frame
(getSunDiscDirection); a host paints the colours.
Type declaration
| Name | Type | Description |
|---|---|---|
color | UniformNode<"vec3", Color> | The broad aura round the sun and the band along the horizon under it. |
discRadii | UniformNode<"vec2", Vector2> | The discs' angular radii in radians: x the sun, y the moon. |
moonDiscColor | UniformNode<"vec3", Color> | - |
moonFace | UniformNode<"vec3", Vector3> | The moon's face as the fog carries it. xy is its phase: the direction of its light in the disc's own frame (moonPhaseLit), x across the terminator and y toward the eye. z is how many texels across the host draws the moon (moonTexelFace), 0 for a smooth disc. (0, 1, 0), the default, is a smooth full moon; a host with neither never touches it. |
moonHaloColor | UniformNode<"vec3", Color> | The halo round the moon's disc. |
sunDirection | UniformNode<"vec3", Vector3> | Toward the sun's disc, never clamped or tilted; the moon is opposite. |
sunDiscColor | UniformNode<"vec3", Color> | The discs as the host draws them in the sky (colour times how much of it shows), for the fog to carry: terrain hides the drawn disc by depth even where its haze has made it the sky's own colour. |
sunHaloColor | UniformNode<"vec3", Color> | The halo the haze scatters round the sun's disc. |
SkyOptions
Ƭ SkyOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
dimension | number | The dimension of the dodecahedron sky. The inner canvas box is 0.8 times this dimension. |
lerpFactor | number | The lerp factor for the sky gradient. The sky gradient is updated every frame by lerping the current color to the target color. set by the setTopColor, setMiddleColor, and setBottomColor methods. |
textureBloomIntensity | number | The emissive boost applied to painted sky texels above textureBloomThreshold. Defaults to 2.0. |
textureBloomThreshold | number | The luminance at which painted sky textures begin to feed bloom. Defaults to 0.72. |
transitionSpan | number | - |
SkyShadingCycleData
Ƭ SkyShadingCycleData: Object
Type declaration
| Name | Type |
|---|---|
color | { bottom: Color | string ; middle: Color | string ; top: Color | string } |
color.bottom | Color | string |
color.middle | Color | string |
color.top | Color | string |
name | string |
skyOffset | number |
start | number |
voidOffset | number |
SlotContent
Ƭ SlotContent: { type: "empty" } | { count: number ; id: number ; type: "block" } | { count: number ; data?: Record<string, unknown> ; id: number ; type: "item" }
SoundEffectEventHandler
Ƭ SoundEffectEventHandler: (payload: SoundEffectEventPayload) => void
Type declaration
▸ (payload): void
Parameters
| Name | Type |
|---|---|
payload | SoundEffectEventPayload |
Returns
void
SoundEffectEventPayload
Ƭ SoundEffectEventPayload: Object
Type declaration
| Name | Type |
|---|---|
id | string |
pitch? | number |
position? | [number, number, number] |
radius? | number |
sourceClientId? | string |
volume? | number |
SunShadowOptions
Ƭ SunShadowOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
isFast | boolean | The 5-tap cross in the near cascades too, for surfaces whose own motion or layering swallows soft shadow detail (water, panes, leaves). |
SurfaceKind
Ƭ SurfaceKind: "atlas-slot" | "own-face" | "isolated-face"
SurfaceState
Ƭ SurfaceState: "unknown" | "default" | "fallback" | "painted"
unknown: the checker.default: an isolated face wearing its face's default art while it waits for the voxel's own paint (blank paper, an empty frame).fallback: painted by World.fillUnpaintedSurfaces, not by its own texture.painted: its own art.
SurfaceTally
Ƭ SurfaceTally: Object
Type declaration
| Name | Type |
|---|---|
default | number |
fallback | number |
painted | number |
total | number |
unknown | number |
SurfaceWeatherShading
Ƭ SurfaceWeatherShading: ReturnType<typeof surfaceWeather>
SurfaceWeatherUniforms
Ƭ SurfaceWeatherUniforms: ReturnType<typeof createSurfaceWeatherUniforms>
TabCompleteContext
Ƭ TabCompleteContext: Object
Options for adding a command.
Type declaration
| Name | Type |
|---|---|
args | Record<string, string> |
TargetType
Ƭ TargetType: "All" | "Player" | "Entity"
TexelAlphaCuts
Ƭ TexelAlphaCuts: Object
The two alphas that sort a texel into a hole, a tint or a solid.
Type declaration
| Name | Type | Description |
|---|---|---|
hole | number | Below this a texel is a hole: the see-through materials' alpha test. |
solid | number | At or above this a texel is solid. |
TexelClasses
Ƭ TexelClasses: Object
Which kinds of texel a see-through surface's textures hold.
Type declaration
| Name | Type | Description |
|---|---|---|
solid | boolean | Texels at or above the solid alpha: they hide what is behind them. |
translucent | boolean | Texels between the hole and solid alphas: they tint what is behind. |
TexelForks
Ƭ TexelForks: Object
Type declaration
| Name | Type |
|---|---|
solid | Material |
translucent | Material |
TexelPlan
Ƭ TexelPlan: "as-is" | "solid" | "translucent" | "split"
How a see-through mesh draws its texels when blended layers do not depend on draw order:
as-is: its material already draws every texel the right way: a cutout with no translucent texels writes depth for all of them, a blended surface with no solid ones blends all of them.solid: a blended surface whose texels are all solid draws as a cutout.translucent: a cutout whose kept texels are all translucent blends.split: solid texels draw with depth, translucent ones blend, from the same buffers in two draws.
TextureCensus
Ƭ TextureCensus: Object
Type declaration
| Name | Type | Description |
|---|---|---|
atlasSlots | SurfaceTally | - |
isolatedFaces | SurfaceTally | - |
ownFaces | SurfaceTally | - |
unpainted | UnpaintedSurface[] | Every surface not wearing its own art, worst first. |
TextureFillResult
Ƭ TextureFillResult: Object
Type declaration
| Name | Type |
|---|---|
color | string |
filled | { atlasSlots: number ; isolatedFaces: number ; ownFaces: number } |
filled.atlasSlots | number |
filled.isolatedFaces | number |
filled.ownFaces | number |
TextureInfo
Ƭ TextureInfo: Object
Type declaration
| Name | Type |
|---|---|
blockId | number |
blockName | string |
canvas | HTMLCanvasElement | null |
faceName | string |
materialKey | string |
range | UV | null |
type | "shared" | "independent" | "isolated" |
TextureInput
Ƭ TextureInput: TextureNode & { value: Texture }
A texture input: node.value swaps the texture it reads.
TextureSlotKind
Ƭ TextureSlotKind: "color" | "depth" | "float" | "uint"
What kind of texture a slot will hold, which fixes its binding type.
TransparencyFlags
Ƭ TransparencyFlags: Object
Type declaration
| Name | Type |
|---|---|
isFluid | boolean |
isSeeThrough | boolean |
lightAttenuation | number |
transparentStandalone | boolean |
TransparentMedium
Ƭ TransparentMedium: "air" | "water"
The medium a see-through effect sits in, as far as water is concerned.
TransparentSortClassification
Ƭ TransparentSortClassification: "single-plane" | "plane-triggers" | "distance"
How a translucent mesh decides when to re-sort:
"single-plane"— every face lies in one plane, so no camera ray can ever hit two faces; the mesh never needs sorting."plane-triggers"— all faces are axis-aligned quads. A valid painter's order can only change when the camera crosses one of the mesh's distinct face planes, so re-sorts fire on plane crossings instead of distance moved (Sodium's trigger model)."distance"— geometry with non-axis-aligned faces falls back to the original re-sort-every-half-block behavior.
TransparentSortStats
Ƭ TransparentSortStats: Object
Cumulative main-thread cost of per-face translucency sorting across all meshes since page load: how many sorts ran, their total/max milliseconds, and the number of faces pushed through the radix sort. Difference two reads for a window; a camera strafe re-sorts every mesh each time it crosses the movement threshold, which is exactly the cost this exists to expose.
Type declaration
| Name | Type |
|---|---|
count | number |
faces | number |
maxMs | number |
totalMs | number |
UV
Ƭ UV: Object
The UV range of a texture on the texture atlas.
Type declaration
| Name | Type | Description |
|---|---|---|
endU | number | The ending U coordinate of the texture. |
endV | number | The ending V coordinate of the texture. |
startU | number | The starting U coordinate of the texture. |
startV | number | The starting V coordinate of the texture. |
UVec2Node
Ƭ UVec2Node: Node<"uvec2">
UVec3Node
Ƭ UVec3Node: Node<"uvec3">
UVec4Node
Ƭ UVec4Node: Node<"uvec4">
UintNode
Ƭ UintNode: Node<"uint">
UnderwaterFogInputs
Ƭ UnderwaterFogInputs: Object
The inputs of the fog the camera looks through under water.
Type declaration
| Name | Type |
|---|---|
cameraSubmersion | FloatNode |
cameraWaterPlaneY | FloatNode |
underwaterAmbient | Vec3Node |
underwaterViewScale | FloatNode |
UniformRef
Ƭ UniformRef<T>: Object
A live value the CPU writes and shaders read: a TSL uniform or texture node.
Type parameters
| Name |
|---|
T |
Type declaration
| Name | Type |
|---|---|
value | T |
UniformTypeOf
Ƭ UniformTypeOf<T>: T extends Color ? "vec3" : T extends Matrix4 ? "mat4" : T extends Matrix3 ? "mat3" : T extends Vector4 ? "vec4" : T extends Vector3 ? "vec3" : T extends Vector2 ? "vec2" : T extends number ? "float" : never
The TSL type a uniform of value T takes in shading code. A Color
uniform is built as color and generates as a vec3; typing it as one
lets colours mix with the vectors they are lit by.
Type parameters
| Name |
|---|
T |
UnpaintedSurface
Ƭ UnpaintedSurface: Object
Type declaration
| Name | Type | Description |
|---|---|---|
ageMs? | number | Isolated faces only: how long the material has existed. |
blockId | number | - |
blockName | string | - |
faceName | string | - |
kind | SurfaceKind | - |
state | Exclude<SurfaceState, "painted"> | - |
textureGroup | string | null | - |
voxel? | Coords3 | Isolated faces only: the voxel whose face this is. |
UpdatingRosterPool
Ƭ UpdatingRosterPool: RosterPool & { update: (deltaTime: number, renderer: Renderer) => void }
ValueUniform
Ƭ ValueUniform<T>: UniformNode<UniformTypeOf<T>, Widen<T>>
Type parameters
| Name |
|---|
T |
Vec2Node
Ƭ Vec2Node: Node<"vec2">
Vec3Node
Ƭ Vec3Node: Node<"vec3">
Vec3Tuple
Ƭ Vec3Tuple: readonly [number, number, number]
Vec4Node
Ƭ Vec4Node: Node<"vec4">
VolumetricCloudLayer
Ƭ VolumetricCloudLayer: Object
One horizontal slab of cloud.
Type declaration
| Name | Type | Description |
|---|---|---|
bottom | number | Height of the slab's underside, in blocks. |
bottomRound | number | Fraction of the slab height over which the underside rounds off. |
cell | Coords3 | Blocks per texel of the noise volume. In the voxel style this is the size of one cloud cube. |
coverage | number | Share of the sky the slab covers, 0..1. |
coverageScale | number | How many noise tiles one sweep of the coverage map spans. |
drift | number | Share of the deck's drift speed this slab moves with: valley cloud barely moves while the high deck sails over it. |
extinction | number | Light lost per block through cloud at full density. |
offset | number | Shifts this slab's noise so two slabs never repeat each other. |
shadeFloor | number | Brightness of the slab's underside relative to its top, 0..1. |
top | number | Height of the slab's top, in blocks. |
topRound | number | Fraction of the slab height over which the top rounds off. |
VolumetricCloudStyle
Ƭ VolumetricCloudStyle: "voxel" | "soft"
How a volumetric deck is drawn.
VolumetricCloudsOptions
Ƭ VolumetricCloudsOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
fadeStartRatio | number | Fraction of maxDistance where the deck starts fading into the haze. |
layers | VolumetricCloudLayer[] | At most two slabs. |
maxDistance | number | How far a ray marches, in blocks. |
noiseSize | Coords3 | Texels of the tileable noise volume. |
seed | number | - |
speed | number | The drift speed along -z, in blocks per second of the shared clock. |
style | VolumetricCloudStyle | - |
VolumetricCloudsSharedUniforms
Ƭ VolumetricCloudsSharedUniforms: VolumetricCloudsSharedInputs
What a volumetric deck reads from the rest of the world (fog, sky glow,
sun, and the cloud colour the day cycle drives): pass the classic deck's
Clouds.shared and both decks light and haze alike.
VoxelBoxBand
Ƭ VoxelBoxBand: Object
One band of a box laid out as a single chunk the mesher reads: a cell of air round the box on every side, and one row of the box above and below the band so its faces cull against the rows they meet.
Type declaration
| Name | Type | Description |
|---|---|---|
firstRow | number | The band's first row of the box. |
height | number | The chunk's height: the band's rows plus one above and one below. |
lights | Uint32Array | - |
rows | number | Rows of the box the band meshes. |
side | number | The chunk's width and depth (the wider of the box's two, plus the air). |
voxels | Uint32Array | - |
VoxelBoxBandOptions
Ƭ VoxelBoxBandOptions: Object
Type declaration
| Name | Type | Description |
|---|---|---|
firstRow | number | - |
lightAt | (x: number, y: number, z: number) => number | - |
rows | number | - |
size | Coords3 | - |
voxels | Uint32Array | - |
VoxelBoxInput
Ƭ VoxelBoxInput: Object
A box of voxels to mesh on its own, away from the chunks.
Type declaration
| Name | Type | Description |
|---|---|---|
bandHeight? | number | Rows meshed per worker job, at most a section's height. |
isRelit? | boolean | Its light is rewritten as it moves (relightLoneCube): every piece keeps a mesh of its own rather than riding the shared opaque batch. |
isUrgent? | boolean | Mesh ahead of the chunk queue. |
origin | Coords3 | The box's lowest corner in the world, where it stands: lights and regional tints are read from the world there. |
size | Coords3 | Voxels along x, y and z. |
voxels | Uint32Array | Raw voxel words, x outermost, then y, then z (a chunk's layout); 0 is air. |
VoxelBoxMesh
Ƭ VoxelBoxMesh: Object
Type declaration
| Name | Type | Description |
|---|---|---|
bands | number | Jobs the box was meshed in, one per band of rows. |
dispose | () => void | - |
group | Group | The box on its own forks of the chunk materials, its lowest corner at the group's origin. Not added to anything: the caller places and moves it, and its textures ride it wherever it goes (VoxelBoxTexelFrame). |
mainThreadMs | number | - |
maxSliceMs | number | The most main-thread time any one frame spent building voxel boxes while this one was built (the budget is shared by every box at once). |
totalMs | number | From the call to every band back from the workers, and the main thread's share of that: filling the bands and building the meshes. |
triangles | number | - |
VoxelBoxWorkCost
Ƭ VoxelBoxWorkCost: Object
What a run of voxel-box work cost the main thread.
Type declaration
| Name | Type | Description |
|---|---|---|
mainThreadMs | number | - |
maxSliceMs | number | The most any one slice ran while this work was queued, including other boxes' work sharing it. |
VoxelInteractOptions
Ƭ VoxelInteractOptions: Object
Parameters to customize the VoxelInteract instance.
Type declaration
| Name | Type | Description |
|---|---|---|
highlightColor | Color | The color of the highlight. Defaults to 0xffffff. |
highlightLerp | number | The lerping factor of the highlight. Defaults to 0.8. |
highlightOpacity | number | The opacity of the highlight. Defaults to 0.8. |
highlightScale | number | The scale of the block highlight. Defaults to 1.002. |
highlightType | "box" | "outline" | The type of the block highlight. Box would be a semi-transparent box, while outline would be 12 lines that outline the block's AABB union. Defaults to "box". |
ignoreFluids | boolean | Whether or not should the VoxelInteract instance ignore fluids when raycasting. Defaults to true. |
inverseDirection | boolean | Whether or not should the VoxelInteract instance reverse the raycasting direction. Defaults to false. |
potentialVisuals | boolean | Debug Whether or not should there be arrows indicating the potential block placement's orientations. Defaults to false. |
reachDistance | number | The maximum distance of reach for the VoxelInteract instance. Defaults to 32. |
VoxelLightVolumeOptions
Ƭ VoxelLightVolumeOptions: Object
Type declaration
| Name | Type |
|---|---|
chunkSize | number |
maxChunk | [number, number] |
maxHeight | number |
maxLightLevel | number |
minChunk | [number, number] |
WaterChannelCoefficients
Ƭ WaterChannelCoefficients: Object
Per-channel coefficients for Beer-Lambert water extinction, expressed per block (~meter) of water. All water rendering derives from this one table.
Type declaration
| Name | Type |
|---|---|
blue | number |
green | number |
red | number |
WaterColumnSample
Ƭ WaterColumnSample: Object
Type declaration
| Name | Type | Description |
|---|---|---|
depth | number | - |
roofed? | boolean | The column ends at a roof: surfaceY is its underside. |
surfaceY | number | - |
WaterOpticsFrameInput
Ƭ WaterOpticsFrameInput: Object
Type declaration
| Name | Type | Description |
|---|---|---|
column | WaterColumnSample | null | The water column over the camera this frame (null in air), measured by the caller — World.measureWaterColumnAt resolves the chunk once and walks it directly, which is why the query is not taken here. |
deltaSeconds | number | - |
sunStrength | number | - |
WorkerPoolJob
Ƭ WorkerPoolJob: Object
A worker pool job is queued to a worker pool and is executed by a worker.
Type declaration
| Name | Type | Description |
|---|---|---|
buffers? | Transferable[] | Any array buffers (transferable) that are passed to the worker. |
message | any | A JSON serializable object that is passed to the worker. |
resolve | (value: any) => void | - |
timeoutMs? | number | Milliseconds this job may run before its worker is presumed dead. A worker that OOMs mid-job dies without any error event, which used to leave the slot occupied and the job unresolved forever (frozen lighting/meshing). On timeout the worker is replaced and the job resolves null. |
WorkerPoolOptions
Ƭ WorkerPoolOptions: Object
Parameters to create a worker pool.
Type declaration
| Name | Type | Description |
|---|---|---|
maxQueuedJobs? | number | Jobs allowed to wait for a free worker before the oldest are shed (resolved null, exactly like a dead worker). Left undefined the queue is unbounded, which is only safe when the caller gates dispatch on WorkerPool.availableCount: every queued job holds its serialized payload alive, so a caller that enqueues faster than workers drain turns the queue into an unbounded allocation. Opt in only from callers that treat a null result as a retryable failure. |
maxWorker | number | The maximum number of workers to create. Defaults to 8. |
name? | string | The name prefix for workers in this pool. Workers will be named {name}-0, {name}-1, etc. Shows up in DevTools for debugging. |
readyMessageType? | string | The type of the message a worker posts once its start-up has finished, for workers whose start-up is asynchronous (a wasm module instantiating on init). Until a worker has posted it the pool hands it no job, a replacement included, and a job's reply is never mistaken for it. Without it a worker takes jobs as soon as it exists. |
WorkerTransferConfig
Ƭ WorkerTransferConfig: Object
Type declaration
| Name | Type |
|---|---|
maxRecentSamples | number |
mode | WorkerTransferMode |
WorkerTransferMode
Ƭ WorkerTransferMode: "auto" | WorkerTransferStrategy
WorkerTransferStrategy
Ƭ WorkerTransferStrategy: "transfer" | "shared"
WorldChunkEvents
Ƭ WorldChunkEvents: Object
Type declaration
| Name | Type |
|---|---|
chunk-data-loaded | (data: ChunkDataEventData) => void |
chunk-loaded | (data: ChunkEventData) => void |
chunk-mesh-loaded | (data: ChunkMeshEventData) => void |
chunk-mesh-unloaded | (data: ChunkMeshEventData) => void |
chunk-mesh-updated | (data: ChunkMeshUpdateEventData) => void |
chunk-unloaded | (data: ChunkEventData) => void |
chunk-updated | (data: ChunkUpdateEventData) => void |
world-definition-changed | (data: { next: string ; previous: string }) => void |
WorldClientOptions
Ƭ WorldClientOptions: Object
The client-side options to create a world. These are client-side only and can be customized to specific use.
Type declaration
| Name | Type | Description |
|---|---|---|
blockTextureFiltering | "nearest" | "mip-aniso" | How the block atlas samples at glancing angles. "nearest" (the default) is the original path: no mips, so a steep wall far from straight-on aliases into streaks because there is no lower-resolution level to fall back to. "mip-aniso" builds a full mip chain (NearestMipmapNearestFilter — each level stays hard-edged, only the level picked changes, so up-close texels stay exactly as crisp) plus anisotropy 4 for the glancing-angle case specifically. Costs a mip chain build per atlas upload and gl.generateMipmap after every animated-tile patch (AtlasTexture.flushAnimationPatches); A/B before defaulting a consumer to it. World.setBlockTextureFiltering flips it live for an A/B run without rebuilding the world. |
borderSwapHoldMs | number | How long, in milliseconds, a finished re-mesh of a section already on screen may wait for a ready neighbour to draw before it swaps in. The re-mesh removes the wall the section drew against that neighbour while it was missing, so swapping it in first opened a gap along the border. 0 swaps every re-mesh in on arrival, the old behaviour. Read on every apply, so it can be flipped for A/B timing. Defaults to 20000, below the 30 s mesh-job watchdog the held job still counts against. |
chunkCullShadowSafeDistance | number | Blocks within which chunks stay visible even when the camera is looking away from them, because geometry behind the camera still casts shadows into the view. Defaults to 160 blocks, comfortably past the shadow cascades' 128-block reach; shorten it below that and near shadows start vanishing as the player turns. In blocks rather than chunks so that a world choosing a coarser chunk size does not silently pin hundreds of chunks visible. |
chunkLoadExponent | number | The exponent applied to the ratio that chunks are loaded, which would then be used to determine whether an angle to a chunk is worth loading. Defaults to 8. |
chunkRequestOverdueMs | number | How long a chunk may stay asked for with no data arriving before the world reports it as unanswered, in milliseconds. The request itself is retried every chunkRerequestIntervalMs meanwhile; the report names each stuck chunk once per interval while it stays stuck, with how often it was asked for and whether any request left this client. 0 turns the report off. Defaults to 60000ms. |
chunkRerequestIntervalMs | number | How long a requested chunk may go unanswered before the request is presumed lost and reissued, in milliseconds. Defaults to 5000ms. |
chunkUniformValues | Partial<Record<keyof ChunkRenderer["uniforms"], number>> | Starting values for the chunk shading's numeric uniforms (their nodes are shared by every material, so they are set, never replaced). Defaults to {}. |
clientOnlyMeshing | boolean | Whether to use client-only meshing. When true, chunks are always meshed locally. When false, server-provided meshes are used for initial chunk load. Defaults to true. |
cloudsOptions | Partial<CloudsOptions> | The options to create the clouds. Defaults to {}. |
defaultRenderRadius | number | The default render radius of the world, in chunks. Change this through world.renderRadius. Defaults to 8 chunks. |
distantDetailCullBelowY | number | null | World Y under which distant chunks are left unmeshed, trading the terrain below it for a much larger render radius. Only chunks farther away than nearDetailRadius are culled; the ones around the player always mesh to the ground, and a chunk fills in the rest as the player approaches. null (the default) meshes everything everywhere. Culling leaves the underside of distant terrain open, so this is only invisible when something opaque sits over the cut — a cloud deck whose lowest surface is above the cut line. Set it above that and distant mountains read as hollow shells. For the same reason the cull applies only while the player is above this line. Underneath it the deck is no longer in the way, so the world meshes in full and gives up the range until they climb back over it. Only applies under clientOnlyMeshing; server-meshed worlds render what they are sent. |
distantDetailCullHysteresis | number | How far above distantDetailCullBelowY the player must climb before culling resumes, having dropped below it. Falling below the line always suspends culling immediately — the gap only delays switching it back on, so that standing at the line does not flip the two states frame by frame. Defaults to 8 blocks. |
farTerrainDistance | number | How far the far-terrain layer reaches past the viewer, in blocks, in a world that serves far terrain (farTerrain in its INIT options). 0 (the default) draws none. Change it through world.farTerrainDistance. |
farTerrainEdgeBand | number | The outer share of the far layer's reach across which it thins into the haze, so its edge never cuts against the sky. Defaults to 0.1. |
farTerrainFogFarRatio | number | With the far layer on, fog closes at this multiple of its reach. Past 1 the layer's far stretch stays partly clear (a range 850 blocks off is about half hazed at 1.6 with a 1024 reach) and the layer thins into the haze across its outer farTerrainEdgeBand. Defaults to 1. |
farTerrainFogNearRatio | number | With the far layer on, fog starts at this fraction of the render distance and closes at the far layer's edge, so loaded terrain stays nearly clear and the far layer fades into haze. Defaults to 0.6. |
farTerrainPalette | number[] | Linear RGB per class the world's far-terrain sampler emits, flattened ([r0, g0, b0, r1, ...]), for a world whose descriptor names no materials (with materials the layer paints each class from its blocks' textures). An empty palette (the default) draws every class grey. |
farTerrainSeamBand | number | How many blocks of the loaded area's outer edge hand over to the far layer across a dithered band, up to half a chunk; 0 leaves the edge hard. Defaults to 0: the band dithers by screen pixel, which shimmers as the view moves, and over anything standing off the ground (a floating island, a tall crown) it interleaves two different shapes. |
farTerrainSkySideColor | string | Underside and wall colour of far floating land, without a skyMaterial. |
farTerrainSkyTopColor | string | Top colour of far floating land, without a skyMaterial. |
farTerrainWaterColor | string | The far water plane's colour. Defaults to a deep sea blue. |
fogCullSlack | number | Blocks past the fog far edge a section may reach before fog culling hides it, absorbing the difference between a section's center distance and the nearest fragment the fog actually shades. |
fogDistance | number | null | A fixed fog distance in blocks, independent of renderRadius. null (the default) derives fog from fogNearRenderRatio/fogFarRenderRatio as before, so fog moves every time the radius changes. Set it to hold fog steady across radius changes — for example raising renderRadius for a vista capture without paying for fog pushed out to match. Always clamped to at most the current render distance (world.fogDistance, World.getBaseFogRange). |
fogFarRenderRatio | number | Fraction of render distance where horizon fog fully hides terrain. Defaults to 0.78. |
fogNearRenderRatio | number | Fraction of render distance where horizon fog starts. Defaults to 0.45. |
isCullingChunksByFog | boolean | Whether the occlusion walk also prunes sections past the fog's far edge, where every fragment already resolves to pure fog color. |
isCullingChunksByFrustum | boolean | Whether whole chunk subtrees are hidden while the camera cannot see them. three.js culls per mesh, but it pays to walk the scene graph first: every node is visited by the matrix pass and the culling pass whether or not it ends up drawn, and a wide render radius is tens of thousands of visits per frame. Testing one box per chunk and hiding the ones that miss lets the renderer skip those branches outright. Requires a camera to be passed to World.update; without one there is nothing to cull against and every chunk stays visible. |
isCullingChunksByOcclusion | boolean | Whether to hide chunk sections the camera provably cannot see through the terrain, walking the mesher-reported face-connectivity graph outward from the camera's own section (Sodium-style occlusion culling). An enclosed interior stops drawing the world around it. Requires WorldClientOptions.isCullingChunksByFrustum, since the walk also carries the frustum test. |
isCullingSpectatorByOcclusion | boolean | Whether the occlusion walk keeps running for a spectating (noclip) camera. A noclip camera can sit inside rock, where faces between solid voxels are never meshed and it sees straight through to whatever the walk would call hidden; so while any voxel the near plane can touch is opaque the walk steps aside for frustum-only culling, and everywhere else (open air, a cave it flew into) it culls exactly as it does for a walking player. false suspends occlusion for the whole flight, the old behaviour. Read every frame, so it can be flipped for A/B timing. |
isOcclusionOpenAtPendingChunks | boolean | Whether a chunk joins the occlusion walk as open air from the moment it is requested, until its own connectivity lands. A chunk with no node blocks every path through it (the walk never turns back), so without this the open terrain behind each still-loading chunk was culled and popped in when the hole filled. false is the old behaviour; read when each request is issued. |
lightJobRetryLimit | number | Maximum number of retries for stale light jobs before falling back to sync. Defaults to 3. |
lightJobTimeoutMs | number | Milliseconds a light worker job may run before its worker is presumed dead (an OOMed worker dies without any error event) and replaced. Defaults to 20000. |
lightSnapshotBudgetBytes | number | Bytes of chunk copies the light workers may hold at once. A relight copies every chunk its light can reach, so jobs that would take the copies in flight past this wait for one to come back; a single job larger than the whole budget still runs, alone, with a warning. Defaults to 96 MB. |
localLights | Partial<LocalLightsOptions> | Budgets, capacities, and quality tier of the local light emitter system (world.localLights). See LocalLightsOptions for the knobs; defaults make an unconfigured world pay nothing. |
maxChunkRequestsPerUpdate | number | The maximum chunk requests this world can request from the server per world update. Defaults to 12 chunks. |
maxDetailRefinementsPerUpdate | number | How many chunks may have their culled levels queued for meshing per world update. Refinement is spread over frames and ordered nearest-first so walking into a region never lands as one burst of mesh jobs. Defaults to 4 chunks. |
maxImmediateServerUpdates | number | Server update batches larger than this are drained through the incremental per-frame update queue instead of being applied (and relit) synchronously in one shot. Defaults to 500 updates. |
maxLightWorkers | number | Maximum concurrent light workers. Defaults to 2. |
maxLightsUpdateTime | number | - |
maxMeshWorkers | number | Mesh workers for the world's own chunks, never more than the device has cores. Each holds the mesher and its copy of the block registry (tens of megabytes), so a page that loads few chunks, or runs on a device short of memory, asks for fewer. Defaults to 4. |
maxMeshesPerUpdate | number | Chunk sections the mesh dispatcher may start in about a frame, air sections (which finish without a worker) included; the rest wait for the next frame. Workers are refilled as their jobs finish, so this only bounds the main thread's dispatch work. Defaults to 32. |
maxOptimisticClientUpdates | number | Client batches larger than this skip the optimistic local apply (with its per-frame relight) and stream straight to the server; the world catches up from the server's tick-batched echo. Keeps bulk edits (WorldEdit) from freezing the tab and guarantees the whole batch is on the wire before any reload. Defaults to 4000 updates. |
maxProcessesPerUpdate | number | The maximum amount of chunks received from the server that can be processed per world update. By process, it means to be turned into a Chunk instance. Defaults to 8 chunks. |
maxQueuedWorkerJobs | number | Jobs allowed to wait for a free mesh or light worker before the oldest are shed. Dispatch is already gated on free worker slots, so this is the backstop that keeps a future caller from parking unbounded serialized chunk payloads in a pool queue. Defaults to 8. |
maxUpdatesPerUpdate | number | The maximum voxel updates that can be sent to the server per world update. Defaults to 1000 updates. |
maxUrgentMeshWorkers | number | Dedicated mesh workers reserved for client-originated voxel edits, never more than maxMeshWorkers. |
maxVoxelHistoryPerVoxel | number | Previous values retained per voxel. Defaults to 4. |
maxVoxelHistoryVoxels | number | Distinct voxels tracked by World.getPreviousValueAt. The history is a debugging convenience, not gameplay state, so it evicts oldest-first instead of growing with every voxel a session ever edits. Defaults to 4096. |
memoryPressure | Partial<MemoryPressureOptions> | Renderer heap watchdog thresholds. See MemoryPressureOptions. |
mergeChunkGeometries | boolean | Whether to merge chunk geometries to reduce draw calls. Useful for mobile. Defaults to false. |
meshApplyBudgetMs | number | Per-frame time budget for applying completed regular mesh results on the main thread, in milliseconds. At least one result always applies per frame; the budget is checked after each apply. Urgent (player-edit) results and the initial join flow bypass the budget entirely. Defaults to 3. |
meshJobTimeoutMs | number | Milliseconds a mesh worker job may run before its worker is presumed dead and replaced. Defaults to 30000. |
meshJobsInFlight | number | Regular (non-urgent) chunk mesh jobs running at once; each worker that finishes takes the next nearest section. More stream terrain in sooner and cost frame time: on a sprint flight (M5 Max) 2 drew a column about 0.9 s after it came into range where 1 took 1.7 s, for about a millisecond more a frame, and 3 or 4 doubled the slowest frames. Capped by the mesh worker pool. Defaults to 2. |
minLightLevel | number | The minimum light level even when sunlight and torch light levels are at zero. Defaults to 0.04. |
nearDetailRadius | number | Chunk radius within which every sub-chunk level is meshed regardless of distantDetailCullBelowY. Defaults to 10 chunks. |
orderIndependentTransparency | OrderIndependentTransparencyOptions | null | Draw every blended surface order-independently (see OrderIndependentTransparencyOptions): water, glass, the translucent texels of any see-through block, and every transparent material in the world's scene, accumulated in any order and composited once. Requires the host to draw the world with World.renderFrame into a render target with a float depth texture; a frame that cannot accumulate says why and draws its layers in list order. null (the default) keeps the sorted pipeline: per-face sorting, medium bands and the per-pixel water side of glass. |
plantDetailDistance | number | null | Block distance out to which plant decoration (grass tufts, flowers — any block the registry marks isPlant) is drawn. Beyond it those meshes are hidden. null (the default) draws them everywhere. Plants cannot share a mesh with the terrain: each species is its own double-sided alpha-tested material, so a chunk with grass and two flower species costs three extra draw calls no matter how few blocks are in them. Across a wide render disc that is most of the frame's draw calls spent on geometry a metre wide, which past a couple of hundred blocks covers well under a pixel. This hides whole meshes rather than fading them, so set it past the point where a tuft is still resolvable or the boundary reads as a moving edge in the ground cover. |
regionArenas | ChunkRegionArenasOptions | null | Region buffer arenas for the shared-opaque chunk bucket. See ChunkRegionArenasOptions. null disables batching and keeps per-section meshes. |
skyOptions | Partial<SkyOptions> | The options to create the sky. Defaults to {}. |
statsSyncInterval | number | The interval between each time the world requests the server for its stats. Defaults to 500ms. |
sunlightChangeSpan | number | The fraction of the day that sunlight takes to change from appearing to disappearing or disappearing to appearing. Defaults to 0.1. |
sunlightEndTimeFrac | number | The fraction of the day that sunlight starts to disappear. Defaults to 0.7. |
sunlightStartTimeFrac | number | The fraction of the day that sunlight starts to appear. Defaults to 0.25. |
swayProfileCapacity | number | Slots in the shared cutout buckets' sway-profile uniform table (one vec4 pair each). Slot 0 is reserved for "no sway", so a world can register one fewer distinct profile than this. Defaults to 16. |
textureUnitDimension | number | The default dimension to a single unit of a block face texture. If any texture loaded is greater, it will be downscaled to this resolution. Defaults to 8 pixels. |
timeForceThreshold | number | The threshold to force the server's time to the client's time. Defaults to 0.1. |
tuftDetailDistance | number | null | Block distance out to which blocks' tufts (Block.tufts) are drawn; beyond it a chunk's tuft batch is hidden and its canopies are their plain cubes. null (the default) draws them everywhere. Like plantDetailDistance it hides whole sections rather than fading, so set it where a tuft's ragged edge no longer reads. |
unpaintedFallbackColor | string | The flat colour World.fillUnpaintedSurfaces paints over a surface still wearing the magenta-and-black unknown checker when there is no better default to give it. A quiet warm grey by default, so a stage with a missing texture reads as unfinished rather than broken. |
useLightWorkers | boolean | Whether to use web workers for light calculations. Defaults to true. |
volumetricCloudsOptions | Partial<VolumetricCloudsOptions> | null | A volumetric cloud deck drawn beside (or instead of) the meshed one; null draws none. Change it live with World.setVolumetricClouds. Defaults to null. |
WorldClock
Ƭ WorldClock: Object
The world clock as the server keeps it: a time of day that wraps at
timePerDay, and a count of the days it has completed. Together they
unwrap into elapsedSeconds, the monotonic clock every client of a
world shares.
Type declaration
| Name | Type | Description |
|---|---|---|
day | number | Days completed since the clock began. |
time | number | Seconds into the current day, in [0, timePerDay). |
WorldFogRange
Ƭ WorldFogRange: Object
The chunk shader's fog near/far, in blocks from the camera.
Type declaration
| Name | Type |
|---|---|
far | number |
near | number |
WorldMemoryCounters
Ƭ WorldMemoryCounters: Object
A snapshot of every queue and in-flight set in the voxel update -> relight -> remesh pipeline. See World.getMemoryCounters.
Type declaration
| Name | Type | Description |
|---|---|---|
activeLightBatchPendingJobs | number | - |
activeLightBatchUndispatchedJobs | number | - |
blockUpdatesApplied | number | Cumulative since world init, so a caller can difference two reads to charge a burst of activity (a water spread, a bulk fill) with exactly the voxel writes and light work it caused. |
blockUpdatesQueue | number | - |
blockUpdatesToEmit | number | - |
lightJobHighWaterChunks | number | - |
lightJobQueue | number | - |
lightJobsScheduled | number | - |
lightQueue | number | - |
lightQueuedBytes | number | - |
lightSeedsAnalyzed | number | Removal + flood seeds handed to the light engine, all colors. |
lightWorking | number | - |
loadedChunks | number | - |
memoryPressure | MemoryPressureStatus | - |
meshDirtyKeys | number | - |
meshInFlightJobs | number | - |
meshQueue | number | - |
meshQueuedBytes | number | - |
meshWorking | number | - |
urgentMeshQueue | number | - |
urgentMeshQueuedBytes | number | - |
urgentMeshWorking | number | - |
voxelHistoryVoxels | number | - |
WorldOptions
Ƭ WorldOptions: WorldClientOptions & WorldServerOptions
The options to create a world. This consists of WorldClientOptions and WorldServerOptions.
WorldServerOptions
Ƭ WorldServerOptions: Object
The options defined on the server-side, passed to the client on network joining.
Type declaration
| Name | Type | Description |
|---|---|---|
airDrag | number | The air drag of everything physical. |
chunkSize | number | The width and depth of a chunk, in blocks. |
doesTickTime | boolean | - |
fluidDensity | number | The density of the fluid in this world. |
fluidDrag | number | The fluid drag of everything physical. |
gravity | number[] | The gravity of everything physical in this world. |
maxChunk | [number, number] | The maximum chunk coordinate of this world, inclusive. |
maxHeight | number | The height of a chunk, in blocks. |
maxLightLevel | number | The maximum light level that propagates in this world, including sunlight and torch light. |
minBounceImpulse | number | The minimum bouncing impulse of everything physical in this world. |
minChunk | [number, number] | The minimum chunk coordinate of this world, inclusive. |
seed | number | The server's world seed. Shared cosmetic randomness — the cloud deck, the shooting-star schedule — derives from it so every client of one world sees the same sky. |
subChunks | number | The number of sub-chunks that divides a chunk vertically. |
timePerDay | number | The time per day in seconds. |
waterLevel | number | The nominal water level of this world, in blocks. |
Variables
AIRLIGHT_SLOTS
• Const AIRLIGHT_SLOTS: 12
Uniform slots of the air-light set: the steady lights of the richest tier plus room for lights still fading out of it. Compile-time in every shader that reads the set (the air effect, the chunk room fill).
BLOCK_LIGHT_GAIN
• Const BLOCK_LIGHT_GAIN: 2.2
BLOCK_LIGHT_HUE_RAMP_LEVEL
• Const BLOCK_LIGHT_HUE_RAMP_LEVEL: number
One flood level (0..1 units): a channel below the peak fades its hue share in over this much of its own level, or over the peak itself when the peak is fainter, so the peak channel is never dimmed.
BLOCK_LIGHT_LOG2_RATIO
• Const BLOCK_LIGHT_LOG2_RATIO: number
15 log2(ratio): the geometric curve's exponent per unit of level.
BLOCK_LIGHT_OWNERSHIP_GAIN
• Const BLOCK_LIGHT_OWNERSHIP_GAIN: 1.5
Safety gain on the analytic claim when it suppresses the baked flood term: the two models approximate the same sources with different falloff curves, so ownership must saturate decisively near a source (fully analytic — N·L and shadows undiluted) while still fading smoothly to the flood look at the claim's edge. Shared by the chunk shader and the CPU entity mirror; change neither side alone.
BLOCK_LIGHT_OWNERSHIP_TAIL
• Const BLOCK_LIGHT_OWNERSHIP_TAIL: Readonly<{ from: 0.1 = 0.1; gain: 0.6 = 0.6; to: 0.5 = 0.5 }>
The gain a faint claim takes instead: under to it falls toward gain,
reached at from. The claim is measured against the flood's curve before
the flood's own gain, so 0.6 is about one to one in light: out in a
lamp's tail it owns a fragment only while it lights it more than its
flood would. At the near gain it owned the whole of its reach, where its
own light (the kernel, its window and the flood mask together) drops to
nothing over the last few blocks: a torch's pool ended on an edge, with
the flood's long soft tail kept off it.
BLOCK_LIGHT_TAIL
• Const BLOCK_LIGHT_TAIL: number
ratio^15, subtracted so level 0 maps to exactly 0.
BLOCK_LIGHT_TRANSFER
• Const BLOCK_LIGHT_TRANSFER: Readonly<{ adaptation: 0.13 = 0.13; ceilingWeight: 0.6 = 0.6; dominanceKnee: 0.06 = 0.06; gain: 2.2 = 2.2; hueLevels: 12 = 12; lampWhite: 1.2 = 1.2; mountFar: 2.5 = 2.5; mountNear: 0.5 = 0.5; ratio: 0.8 = 0.8; tightKernelCoreRatio: 0.2 = 0.2; tightKernelGain: 2 = 2.0 }>
How flood block light (torches, lanterns, glowberries) turns into light on a surface: the single source for the chunk fragment, its local-light ownership math and every CPU mirror (entity light, the client's entity lighting utils). See docs/design/rendering/2026-09-23-block-light- illumination.md, steps 6 and 7.
The flood stores 0..15 per channel and loses one level per block. The
legacy map (smoothstep, gain 1.2, per-channel ACES) turned that into a
flat plateau with a cliff at the edge, and walked every coloured light's
hue to pure red as its weaker channels died first. The geometric map
keeps a fixed ratio per level, so the decline is even block to block
and a light keeps its hue while its channels are alive; the tone map
preserves hue for block-lit fragments. Daylight is unchanged: every new
term rides torchDominance, which is 0 in a sunlit frame.
The chunk shading's TSL twin is shading/block-light.ts; change neither alone.
BLOCK_LIGHT_TRANSFER_KERNEL_CORE
• Const BLOCK_LIGHT_TRANSFER_KERNEL_CORE: 0.2
The analytic kernel's core, as a fraction of a light's range.
BLOCK_LIGHT_WARM_TINT
• Const BLOCK_LIGHT_WARM_TINT: readonly [number, number, number]
Warm tint for flood light; saturated emitters keep their own hue. Gold rather than orange: under (1.05, 0.92, 0.75) on top of a torch's own amber, green crops went olive and soil went rust, and a lit field lost the colours that tell its plants apart.
BLUE_LIGHT
• Const BLUE_LIGHT: "BLUE"
The string representation of blue light.
BOX_SIDES
• Const BOX_SIDES: BoxSides[]
The six default faces of a canvas box.
BYTE_VECTOR_STRIDE
• Const BYTE_VECTOR_STRIDE: 4
WebGPU vertex strides are whole 4-byte words, so an attribute of three one-byte components (a quantized normal, a biome tint) needs a fourth. three pads such an attribute itself, but it re-pads it on every upload with a per-vertex loop that makes a view per vertex: a merged section updated in play allocated ~150 MB/s and stalled frames on the collector. Chunk geometry carries these attributes four-wide from the start (the shaders read three; the fourth is dropped).
CANVAS_BOX_ATLAS_GUTTER
• Const CANVAS_BOX_ATLAS_GUTTER: 8
Texels of the face's own repeat kept round each face in a merged layer's atlas. Face origins and cell edges land on multiples of it too, so for a face whose size is a multiple of eight the first three mip levels hold exactly the texels its own wrapping texture's mips did.
CANVAS_BOX_GROUP_FACES
• Const CANVAS_BOX_GROUP_FACES: readonly BoxFace[]
The face each BoxGeometry group draws, by group index (px, nx, py, ny,
pz, nz): the order of a layer's per-face material array.
CHAT_HISTORY_METHOD
• Const CHAT_HISTORY_METHOD: "vox-builtin:chat-history"
Method a client calls for an older page of the world's chat history.
CHAT_HISTORY_PAGE_SIZE
• Const CHAT_HISTORY_PAGE_SIZE: 50
Lines one history page asks for by default (the server caps it at 100).
CHUNK_DAYLIGHT
• Const CHUNK_DAYLIGHT: Object
The chunk fragment's daylight terms for an open face in full sun (no shadow, no occlusion, no block light), as the numbers both shaders use. The chunk material (chunk-material.ts) is the source of truth; far-terrain.test.ts reads both and fails when either side changes alone.
Type declaration
| Name | Type | Description |
|---|---|---|
bounce | 0.04 | ambientColor * 0.04 * (1 - shadow): light bounced into shade. |
brightTexture | { from: 0.75 = 0.75; to: 0.95 = 0.95 } | smoothstep(0.75, 0.95, texLuma): how bright a texture counts as. |
brightTexture.from | 0.75 | - |
brightTexture.to | 0.95 | - |
brightTextureSun | 0.7 | mix(1, 0.7, isBrightTex): the sun a bright texture keeps. |
daylightBalance | readonly [1, 1, 1] | Daylight white balance. |
groundAmbient | 0.4 | ambientColor * 0.4: the sky ambient a face looking down gets. |
shadedAmbient | 0.72 | mix(0.72, 1, shadow): the sky ambient a shaded face keeps. |
starlight | readonly [0.025, 0.03, 0.04] | vec3(0.025, 0.03, 0.04) * sunVisibility: starlight under open sky. |
sunWrap | { bias: 0.15 = 0.15; scale: 0.85 = 0.85 } | max(rawNdotL * 0.85 + 0.15, 0): the wrapped sun. |
sunWrap.bias | 0.15 | - |
sunWrap.scale | 0.85 | - |
toneMap | { a: 2.51 = 2.51; b: 0.03 = 0.03; c: 2.43 = 2.43; d: 0.59 = 0.59; e: 0.14 = 0.14 } | The ACES fit (x (2.51 x + 0.03)) / (x (2.43 x + 0.59) + 0.14). |
toneMap.a | 2.51 | - |
toneMap.b | 0.03 | - |
toneMap.c | 2.43 | - |
toneMap.d | 0.59 | - |
toneMap.e | 0.14 | - |
CHUNK_PENDING_GRACE_MS
• Const CHUNK_PENDING_GRACE_MS: 6000
How long after loading a chunk column may still count as pending while it owes its mesh. Past this the far layer may show through it again: a section a missing neighbour keeps failing to mesh (the loaded disc's perimeter has no outer halo) must not pin sky over the far layer for the rest of the session, and a chunk that is simply slow gets the old behaviour back, the far layer standing in until its terrain lands.
CHUNK_WATER_FRESNEL
• Const CHUNK_WATER_FRESNEL: Object
The chunk water's Fresnel on a top face, as the numbers both shaders use; far-terrain.test.ts fails when either side changes alone.
Type declaration
| Name | Type |
|---|---|
base | number |
max | number |
CHUNK_WATER_TINT
• Const CHUNK_WATER_TINT: Object
How much of its tint the chunk water's colour takes with distance, on a
top face where the vertical term is 0: near up close, toward far as
1 - exp(-distance * perBlock) grows, scaled by reach.
Type declaration
| Name | Type |
|---|---|
far | 0.28 |
near | 0.1 |
perBlock | 0.008 |
reach | 0.72 |
CONNECTIVITY_FULL
• Const CONNECTIVITY_FULL: 32767
All fifteen unordered face pairs connected — the encoding for a section the eye passes straight through (all air, or not yet meshed).
CRUSTED_FLUID_DEFAULTS
• Const CRUSTED_FLUID_DEFAULTS: Required<CrustedFluidShaderOptions>
DEATH_BODY_GONE_MS
• Const DEATH_BODY_GONE_MS: number
Milliseconds from start() until the body has shrunk to nothing — the
moment a dying thing is gone from where it fell. Anything that follows a
death (a wake teleport, a respawn) keys off this so it lands only once
observers have watched the body vanish.
DEFAULT_BLOCK_MAX_STACK
• Const DEFAULT_BLOCK_MAX_STACK: 64
DEFAULT_CHUNK_SWAY
• Const DEFAULT_CHUNK_SWAY: ChunkSwayConstants
DEFAULT_ENTITY_FACE_SHADES
• Const DEFAULT_ENTITY_FACE_SHADES: EntityFaceShades
DEFAULT_METHOD_CONFIRM_TIMEOUT_MS
• Const DEFAULT_METHOD_CONFIRM_TIMEOUT_MS: 5000
DEFAULT_PART_TEXEL_DENSITY
• Const DEFAULT_PART_TEXEL_DENSITY: TexelDensity
Texels per block for part atlases built here, and the smallest face.
EMISSIVE_LEVELS
• Const EMISSIVE_LEVELS: [number, number, number, number]
The four strengths an emissive face can render at, indexed by the two AO
bits under the vertex emissive bit. Mirrors EMISSIVE_LEVELS in
crates/mesher/src/mesher/vertex_light.rs; change neither side alone.
ENTITY_ATLAS_COLS
• Const ENTITY_ATLAS_COLS: 6
ENTITY_AVERAGE_NDOTL
• Const ENTITY_AVERAGE_NDOTL: 0.5
Average of the shader's wrapped NdotL over a body's faces. A cube in
midday sun: the top face near 0.75, the bottom at 0, the sides between,
averaging about one half. Also the N·L the local-light Lambert wrap is
evaluated at.
ENTITY_HEMISPHERE_BLEND
• Const ENTITY_HEMISPHERE_BLEND: 0.5
The sky hemisphere blend vWorldNormal.y * 0.5 + 0.5 averaged over a
body: vertical faces sit at 0.5 and top and bottom cancel, so the sky
ambient lands between groundColor and uAmbientColor.
ENTITY_SHADOW_DISTANCE
• Const ENTITY_SHADOW_DISTANCE: 32
Blocks from the player within which entities cast dynamic shadows. The cascade entity refresh and the caller's decision of whether any entity is worth a refresh at all must agree on this number, or entities outside it trigger full cascade re-renders for shadows that are then distance-culled before drawing.
ENTITY_SHADOW_SELF_BOUNDS_MARGIN
• Const ENTITY_SHADOW_SELF_BOUNDS_MARGIN: 0.15
InstancedSkinnedMaterialOptions.shadowSelfBoundsMargin's default.
FAR_TERRAIN_METHOD
• Const FAR_TERRAIN_METHOD: "vox-builtin:far-terrain"
The method a client calls for far-terrain tiles, and its reply's name.
FLOW_CREST_PHASE_PER_HEIGHT
• Const FLOW_CREST_PHASE_PER_HEIGHT: number
Radians of flow-crest phase per block of rest height: one full crest every WATER_OPTICS.flowCrestSpacingBlocks blocks on a sheet falling a full stage per block.
FLUID_SPILL_CORNER_MIN_HEIGHT
• Const FLUID_SPILL_CORNER_MIN_HEIGHT: number
Rest height within its voxel above which a fluid surface vertex is a spill corner — one the mesher raised to the full block because fluid stands on a voxel sharing it, so the sheet meets the wall of the block pouring onto it. A resting surface sits at WATER_OPTICS.fluidSurfaceHeight and every flow stage only lowers it, so nothing else reaches past this midpoint. The vertex stage leaves these corners out of the wave: the wall edge they are welded to sits on its voxel floor and cannot move with them.
FLUID_WAVE
• Const FLUID_WAVE: Object
The swell a resting fluid surface rides: three octaves of the chunk shader's simplex noise over world x/z and the shader clock. The vertex stage sums this table (fluidWaveNode), and fluidWaveOffset sums the same octaves on the CPU, so something floating on the water can ride the surface the player sees instead of sinking into its crests. The shader clock follows the world's shared clock, so every client draws, and floats on, the same swell.
Type declaration
| Name | Type | Description |
|---|---|---|
octaves | readonly [{ amplitude: 0.08 = 0.08; driftX: 0.3 = 0.3; driftZ: -0.2 = -0.2; frequency: 0.15 = 0.15; seed: 0 = 0 }, { amplitude: 0.04 = 0.04; driftX: -0.5 = -0.5; driftZ: 0.4 = 0.4; frequency: 0.4 = 0.4; seed: 10 = 10 }, { amplitude: 0.02 = 0.02; driftX: 0.7 = 0.7; driftZ: -0.5 = -0.5; frequency: 0.8 = 0.8; seed: 20 = 20 }] | - |
timeScale | 0.0006 | Shader clock (ms) to wave time. |
FROZEN_METADATA_KEY
• Const FROZEN_METADATA_KEY: "frozen"
Metadata key the server sets on entities pinned by the freeze mechanic. While true, the client must hold the entity's pose: its class update (animation clocks, interpolation) is skipped entirely.
GREEN_LIGHT
• Const GREEN_LIGHT: "GREEN"
The string representation of green light.
HIT_FLASH
• Const HIT_FLASH: Object
The flash a struck body shows, for any rig that owns its own tint: a near-white pop the frame the blow lands, then red that holds and fades. Rigs mix toward it after their lighting, so a body struck in the dark still flashes. A game passes its own HitFlashProfile for bodies that should flash fainter (faces that must stay legible, worn armour).
Type declaration
| Name | Type |
|---|---|
fadeMs | 160 |
holdMs | 90 |
peak | 0.75 |
popAmount | 0.8 |
popMs | 40 |
HIT_FLASH_MS
• Const HIT_FLASH_MS: number
Milliseconds from the blow until the flash is gone.
HIT_FLASH_POP
• Const HIT_FLASH_POP: Color
HIT_FLASH_RED
• Const HIT_FLASH_RED: Color
The flash's red and its pop, in the shaders' working (linear) space.
HIT_RECOIL_MS
• Const HIT_RECOIL_MS: 120
The recoil lean a struck body takes: out and back over this long.
INVALID_LIGHT_HANDLE
• Const INVALID_LIGHT_HANDLE: LightHandle = 0
INVALID_LOCAL_LIGHT_HANDLE
• Const INVALID_LOCAL_LIGHT_HANDLE: number = INVALID_LIGHT_HANDLE
LAMBERT_REACH
• Const LAMBERT_REACH: Readonly<{ end: 0.6 = 0.6; farWrap: 0.85 = 0.85; start: 0.15 = 0.15 }>
How a lamp's light loses its direction with distance. Near the lamp a
surface is lit by the lamp's own ray, so its facing shapes it
(LAMBERT_WRAP). Further out, what arrives has bounced off the ground
and the walls on its way and comes from everywhere: the wrap rises to
farWrap between start and end of the light's range. Without it a
torch a block and a half over open ground lit it at a grazing angle:
four blocks out the ground took a quarter of the light a wall there
took, while the lamp still owned the fragment and kept the baked flood
off it, so a torch's pool on the ground was half as wide with the
analytic lights on as with them off.
LAMBERT_WRAP
• Const LAMBERT_WRAP: 0.25
Same diffuse wrap the cone lights use, so a surface grazing any local
light keeps the same rim response. Exported for the CPU entity mirror
(composeEntityLight), which has no per-fragment normal and applies the
wrap at an average N·L instead; change neither side alone.
LIGHT_CONES
• Const LIGHT_CONES: Readonly<{ lambertWrap: 0.25 = 0.25; maxCones: 8 = 8; minCosDelta: 0.001 = 1e-3; scatterBands: 0 = 0; scatterCeiling: 0.3 = 0.3; scatterSamples: 4 = 4; scatterTexelsPerBlock: 16 = 16 }>
Engine-side budget and falloff shaping for dynamic spot-light cones (flashlights, vehicle headlights). The cone list is rebuilt every frame by the game; shaders iterate a small fixed array so the cost stays flat.
LIGHT_CONE_STRIDE
• Const LIGHT_CONE_STRIDE: 4
LIGHT_FLAG_FLICKER
• Const LIGHT_FLAG_FLICKER: 4
LIGHT_FLAG_MASKED
• Const LIGHT_FLAG_MASKED: 2
LIGHT_FLAG_SHADOW_REQUEST
• Const LIGHT_FLAG_SHADOW_REQUEST: 8
LIGHT_FLAG_STATIC
• Const LIGHT_FLAG_STATIC: 1
LIGHT_QUALITY_TIERS
• Const LIGHT_QUALITY_TIERS: Record<LightQualityTier, Pick<LocalLightsOptions, "maxClusteredLights" | "maxLightsPerCell" | "analyticRadius" | "fluidSpecularStrength" | "maxShadowedLights" | "shadowAtlasSize" | "shadowSlotSize" | "shadowLedgerUnitsPerFrame"> & { blockLightOwnership: number }>
Tier presets are data only: applying one changes pack-time caps and
uniforms, never shaders. potato turns the clustered layer off entirely,
rendering exactly the pre-local-lights frame plus emissive faces.
LOAD_PHASE_BATCH_MS
• Const LOAD_PHASE_BATCH_MS: 8
MAX_CLUSTERED_LIGHTS
• Const MAX_CLUSTERED_LIGHTS: 255
Hard ceiling of the packed set: a grid slot holds row + 1 in a byte.
MAX_HEAD_PITCH
• Const MAX_HEAD_PITCH: 0.52
MAX_HEAD_YAW
• Const MAX_HEAD_YAW: 0.78
MAX_LIGHTS_PER_CELL
• Const MAX_LIGHTS_PER_CELL: 8
Compile-time slot count of the shader loop. Quality tiers cap how many slots the CPU fills, never this constant, so no tier change recompiles.
METHOD_REJECTED_REPLY
• Const METHOD_REJECTED_REPLY: "vox-builtin:method-rejected"
The reply a server sends when a call reached the world and did nothing:
the world's guard refused it, or its handler turned it down or panicked.
{ method, world, reason }.
NX_ROTATION
• Const NX_ROTATION: 3
The numerical representation of the negative X rotation.
NY_ROTATION
• Const NY_ROTATION: 1
The numerical representation of the negative Y rotation.
NZ_ROTATION
• Const NZ_ROTATION: 5
The numerical representation of the negative Z rotation.
OFFSCREEN_DEFAULT_RADIUS
• Const OFFSCREEN_DEFAULT_RADIUS: 2
Entity.offscreenRadius when an entity names none.
OIT_AFTER_RENDER_ORDER
• Const OIT_AFTER_RENDER_ORDER: 999999.5
Transparent materials that cannot accumulate (additive light, which needs no order, and blend modes the accumulation cannot express) draw here, over the composite.
OIT_BLENDED_RENDER_ORDER
• Const OIT_BLENDED_RENDER_ORDER: 0
Every blended material, accumulated in whatever order the list has.
OIT_CLOSE_RENDER_ORDER
• Const OIT_CLOSE_RENDER_ORDER: 999999
Switches back and composites the accumulation over the scene.
OIT_DEPTH_WRITING_RENDER_ORDER
• Const OIT_DEPTH_WRITING_RENDER_ORDER: -0.75
Transparent materials that write depth: cutouts, solid texels, masks.
OIT_OPEN_RENDER_ORDER
• Const OIT_OPEN_RENDER_ORDER: -0.5
Switches the scene's target to the accumulation target.
OIT_PHASE_ALL
• Const OIT_PHASE_ALL: 0
Which fragments of a blended material a pass keeps.
OIT_PHASE_BEHIND
• Const OIT_PHASE_BEHIND: 1
OIT_PHASE_FRONT
• Const OIT_PHASE_FRONT: 2
OIT_SPLIT_RENDER_ORDER
• Const OIT_SPLIT_RENDER_ORDER: 999998
With a separating surface in view (see OrderIndependentSeparator):
composites what lies behind it, then draws the blended band again for
the surface and what lies in front of it.
ON_REQUEST_METADATA_METHOD
• Const ON_REQUEST_METADATA_METHOD: "vox-builtin:on-request-metadata"
Method that asks the server for the world's on-request entity metadata keys (debug views it replicates only on request) or stops them.
OPAQUE_RENDER_ORDER
• Const OPAQUE_RENDER_ORDER: 100
ORDER_INDEPENDENT_KEY
• Const ORDER_INDEPENDENT_KEY: "orderIndependent"
Set material.userData[ORDER_INDEPENDENT_KEY] = false to keep a material out.
PIGMENT_CODE
• Const PIGMENT_CODE: 15
Stack-count code that marks a colour-table face under the sign bit
(mirrors PIGMENT_CODE in the mesher's vertex_light.rs and in
shaders.ts). Such a face keeps its table colour in every climate.
POINT_FACE_GUARD_TAN_HALF
• Const POINT_FACE_GUARD_TAN_HALF: 1.04
Half-FOV tangent of a point-light cube face. Exactly 90° would put shared cube edges precisely on the map border, where PCF taps clamp; the 4 % guard band renders a sliver past the edge so filtered lookups near a face boundary still land on real depth. The sampling reconstruction uses the same constant, so render and lookup always agree.
POSITION_BLOCK_BIAS
• Const POSITION_BLOCK_BIAS: 32
Compact vertex format for chunk geometry, adapted from Sodium's compact
vertex layout. Positions store as unsigned 16-bit fixed point in
1/positionUnitsPerBlock block units, biased by POSITION_BLOCK_BIAS
blocks so face geometry that pokes slightly outside its section (rotated
plant crosses, dynamic-pattern parts) stays representable. The scale is
derived per world from its section extent — Sodium can hardcode one scale
because its sections are always 16 blocks tall, but a world here may run a
single 352-block sub-chunk, and a fixed scale wide enough for the small
case silently wraps every vertex above the u16 ceiling in the tall one.
UVs store as normalized u16 (the atlas keeps every vertex UV inside
[0, 1]; greedy tiling reconstructs its repeat from world position in the
fragment shader). Normals store as normalized i8. Together with the i32
packed light this is 17 bytes of attributes per vertex, down from 36;
the four-byte light twist (quad-light.ts) brings it to 21.
The dequantization scale and bias live in the mesh (or arena instance)
matrix, never in the shader: the CSM depth pass renders the whole scene
through one scene.overrideMaterial and can only be correct if the
transform carries the mapping back to block space. Chunk materials still
receive POSITION_UNITS_PER_BLOCK as a define because sway and wave
displacement math reads the raw position attribute before any matrix
applies.
Geometry that the transparent sorter rewrites on the main thread (fluids
and depth-non-writing see-through blocks such as glass) keeps full f32
attributes: the sorter's per-face keys read positions directly, and those
buckets are a small fraction of the scene. isMainThreadSortedBlock
mirrors the depthWrite rule in chunk-materials.ts exactly — every
material therefore serves either only quantized or only float meshes.
POSITION_STRIDE
• Const POSITION_STRIDE: 4
Quantized positions are 16-bit (vertex-quantization.ts), and WebGPU has no
three-wide 16-bit vertex format: three widened every such attribute to 32
bits on its first upload, a fresh array per mesh that also replaced the
geometry's own, so a chunk's positions took twice the memory and the
region arenas adopted the widened type for every page. They are carried
four-wide (uint16x4) instead, the fourth lane holding the vertex's sway
profile (World.swayProfileTable, 0 for none): a shared cutout needs no
attribute of its own for it, and every quantized chunk geometry shares one
vertex layout.
PX_ROTATION
• Const PX_ROTATION: 2
The numerical representation of the positive X rotation.
PY_ROTATION
• Const PY_ROTATION: 0
The numerical representation of the positive Y rotation.
PZ_ROTATION
• Const PZ_ROTATION: 4
The numerical representation of the positive Z rotation.
QUAD_LIGHT_CORNER_FLAG
• Const QUAD_LIGHT_CORNER_FLAG: 64
Flag added to a byte whose vertex is a diagonal corner (never reached by a twist).
QUAD_LIGHT_TWIST_BIAS
• Const QUAD_LIGHT_TWIST_BIAS: 30
Twist bias: a twist spans -30..30 (four corners of 0..15), stored 0..60.
QUAD_LIGHT_TWIST_NEUTRAL
• Const QUAD_LIGHT_TWIST_NEUTRAL: readonly [number, number, number, number]
What a vertex without the attribute reads: no twist, not a diagonal corner. Materials bind it as the attribute's default value.
REBUILD_COOLDOWN_MS
• Const REBUILD_COOLDOWN_MS: 200
The shortest time between two regular rebuilds of one section that is already on screen. A stream of changes the player did not make (a forest burning, water running, a neighbour's light moving) re-dirties its sections every frame, and each rebuild is a worker job plus an upload of the whole section on the main thread: started as fast as the workers freed up, they took every worker and the whole apply budget, and ground with nothing drawn yet waited behind them. A section rebuilt inside this window stays dirty and picks up everything that changed meanwhile in one rebuild when it ends. A section's first mesh and its first rebuild after a quiet spell start at once, and player edits take the urgent lane.
RED_LIGHT
• Const RED_LIGHT: "RED"
The string representation of red light.
SCENE_OVERLAY_LAYER
• Const SCENE_OVERLAY_LAYER: 30
The dedicated render layer that all in-world overlay objects (sprite texts,
nametags, and other HUD-like scene decorations) live on. Cameras that should
display overlays must call camera.layers.enable(SCENE_OVERLAY_LAYER);
disabling the layer on a camera renders a clean frame with no overlays,
which is how pure screenshots are captured.
SEE_THROUGH_ALPHA_TEST
• Const SEE_THROUGH_ALPHA_TEST: 0.1
Below this texel alpha a see-through chunk material discards the texel.
SHADER_CLOCK_MAX_STEP_SECONDS
• Const SHADER_CLOCK_MAX_STEP_SECONDS: 1
A frame's advance is taken whole up to the snap: the shared clock is the truth, so a slow frame (a 2 fps background tab) keeps pace with it rather than falling behind and snapping back every few frames. A longer stall snaps.
SHADER_CLOCK_SLEW_RATE
• Const SHADER_CLOCK_SLEW_RATE: 0.1
Seconds of correction absorbed per second of play, as a fraction: at 0.1 a 0.1s correction plays out over a second, with the animation running 10% fast or slow meanwhile.
SHADER_CLOCK_SNAP_SECONDS
• Const SHADER_CLOCK_SNAP_SECONDS: 1
Corrections above this are taken at once; smaller ones are slewed.
SHADER_CLOCK_WRAP_SECONDS
• Const SHADER_CLOCK_WRAP_SECONDS: 16384
Wrap period of the shader clock, in seconds: 2^14, under 2^24 ms.
SHADOW_FACE_FORWARD
• Const SHADOW_FACE_FORWARD: readonly [number, number, number][]
Cube-face bases for local point-light shadows, index-matched between this
table (which builds the render cameras) and the reconstruction in
shader.ts (which turns a fragment position back into a face UV + depth).
The basis is right-handed for a camera looking down forward
(right × up = -forward); change neither side alone.
Faces: 0 +X, 1 -X, 2 +Y, 3 -Y, 4 +Z, 5 -Z.
SHADOW_FACE_RIGHT
• Const SHADOW_FACE_RIGHT: readonly [number, number, number][]
SHADOW_FACE_UP
• Const SHADOW_FACE_UP: readonly [number, number, number][]
SHARED_CHUNK_MATERIAL_KEYS
• Const SHARED_CHUNK_MATERIAL_KEYS: readonly ["shared-opaque", "shared-cutout", "shared-cutout-plant", "shared-cutout-cube", "shared-tufts"]
The bucket materials many blocks draw with at once.
SHARED_CUTOUT_CUBE_MATERIAL_KEY
• Const SHARED_CUTOUT_CUBE_MATERIAL_KEY: "shared-cutout-cube"
SHARED_CUTOUT_MATERIAL_KEY
• Const SHARED_CUTOUT_MATERIAL_KEY: "shared-cutout"
SHARED_CUTOUT_PLANT_MATERIAL_KEY
• Const SHARED_CUTOUT_PLANT_MATERIAL_KEY: "shared-cutout-plant"
SHARED_OPAQUE_MATERIAL_KEY
• Const SHARED_OPAQUE_MATERIAL_KEY: "shared-opaque"
SHARED_TUFTS_MATERIAL_KEY
• Const SHARED_TUFTS_MATERIAL_KEY: "shared-tufts"
Every tufted block's tufts (Block.tufts): one double-sided cutout material on the atlas, so the mesher lays each tuft quad once and a chunk's tufts of every species are one batch.
SPOT_GUARD_SCALE
• Const SPOT_GUARD_SCALE: 1.05
The same guard applied to a spot cone's authored outer angle.
SUNLIGHT
• Const SUNLIGHT: "SUNLIGHT"
The string representation of sunlight.
SURFACE_OPEN_LIGHT
• Const SURFACE_OPEN_LIGHT: Object
The voxel sunlight (0..1) over which a material's faces count as open to
the sky (uSurfaceOpenLight, per material). A solid face carries the
light of the air in front of it, which only the open sky keeps at its
full level. A see-through block (leaves, glass, plants) carries its own
voxel's light instead, which its own attenuation has already lowered: a
canopy's top leaves read 13 of 15 under open sky and the leaves a block
deeper 11, so they open lower and sharper.
Type declaration
| Name | Type |
|---|---|
seeThrough | readonly [number, number] |
solid | readonly [0.85, 0.98] |
SURFACE_POCK_MEAN
• Const SURFACE_POCK_MEAN: number
The mean brightness a pock adds to a texel over time at full chance: what the pattern averages to once texels are too small to draw it.
SURFACE_RESPONSE
• Const SURFACE_RESPONSE: Object
How far a chunk material takes the weather (uSurfaceResponse, per
material): its wetness. Zero skips the material entirely.
Type declaration
| Name | Type | Description |
|---|---|---|
cutout | 1 | Leaves and other cutouts. |
fluid | 0 | Fluids: their own rings, in the water's branch. |
seeThrough | 0 | Blended see-through blocks (glass): never darkened. |
solid | 1 | Solid ground and everything drawn like it. |
SURFACE_WEATHER
• Const SURFACE_WEATHER: Object
The tuning of every surface-weather term, shared by the shading and its CPU twins.
Type declaration
| Name | Type | Description |
|---|---|---|
coatMean | { from: -0.02 = -0.02; to: 1.04 = 1.04 } | The share of ground the coat covers on average at coat c, as speckle + (1 - speckle) smoothstep(from, to, drifts) (fit to the drift field, within about 1%): what a coat seen from too far to resolve its drifts is drawn as. |
coatMean.from | -0.02 | - |
coatMean.to | 1.04 | - |
coatSpeckle | 0.2 | - |
driftContrast | 1.45 | - |
driftFadeFrom | 0.35 | Blocks per pixel over which the drift patches hand over to their mean. |
driftFadeTo | 1 | - |
driftScaleLarge | 3.5 | The coat's drift field: two octaves (blocks per cell), weights, contrast. |
driftScaleSmall | 1.3 | - |
driftSoftness | 0.12 | Half-width of the coat's drift edge; the even speckle a fresh coat starts with (single texels, the first minute); and the coat past which the drifts begin to fill. |
driftStart | 0.2 | - |
driftWeightLarge | 0.7 | - |
lineBand | 6.25 | The default half-width of the band the coat fades in over, blocks. |
lineJitterLarge | { cell: 23 = 23; swing: 6 = 6 } | The roughening of the snow line, blocks: two octaves of (cell, swing). |
lineJitterLarge.cell | 23 | - |
lineJitterLarge.swing | 6 | - |
lineJitterSmall | { cell: 7 = 7; swing: 2 = 2 } | - |
lineJitterSmall.cell | 7 | - |
lineJitterSmall.swing | 2 | - |
pockCellTexels | 4 | Drop pocks: texels per cell side (one splash at a time per cell), slots per second per cell, the share of slots that splash at full rain, and each frame's end (seconds) and brightness: a dot, a plus, a faint ring. |
pockChance | 0.6 | - |
pockFadeFrom | 0.8 | Pixels per texel over which a pock hands over to its average shimmer. |
pockFadeTo | 2 | - |
pockFrames | readonly [0.04, 0.09, 0.15] | - |
pockGround | 0.35 | - |
pockRate | 0.8 | - |
pockSky | 0.35 | What a pock adds: this much of the sky's light, and of the ground's own. |
pockWeights | readonly [1, 0.8, 0.35] | - |
ringChance | 0.7 | - |
ringCrest | 0.3 | How far a ring's crest lifts the water toward the sky it mirrors. |
ringFadeFrom | 14 | - |
ringFadeTo | 36 | - |
ringLayers | 3 | Rain rings on still water: three layers of one-block cells, a ring's life (s), its widest radius (blocks), the wave's sharpness (radians per block), the share of slots that ring, the slope it tilts the surface by, and the distance (blocks) it fades over. |
ringLife | 0.75 | - |
ringRadius | 0.3 | - |
ringSharpness | 45 | - |
ringSlope | 0.25 | - |
sideWet | 0.25 | Wetness a wall keeps, and what facing into the wind adds. |
upFrom | 0.55 | World normal y over which a face counts as facing up. |
upTo | 0.9 | - |
wetDarken | 0.65 | Albedo scale of fully wet porous ground, and its saturation lift. |
wetSaturation | 0.15 | - |
windwardWet | 0.6 | - |
SURFACE_WEATHER_TEXELS
• Const SURFACE_WEATHER_TEXELS: 16
Texels per block side: the grid every ground effect snaps to.
TORCH_GAIN
• Const TORCH_GAIN: 2.2
vec3 torchLight = smoothTorch * gain (block-light-transfer.ts).
TRANSPARENT_CUTOUT_RENDER_ORDER
• Const TRANSPARENT_CUTOUT_RENDER_ORDER: number
See-through chunk meshes that write depth (alpha-tested cutouts such as foliage) draw before everything blended. A cutout hides what is behind its painted texels either way, and its depth then hides a blended layer behind it, where drawn after it the cutout would paint over one in front of it.
TRANSPARENT_FLUID_RENDER_ORDER
• Const TRANSPARENT_FLUID_RENDER_ORDER: 100001
TRANSPARENT_MEDIUM_KEY
• Const TRANSPARENT_MEDIUM_KEY: "transparentMedium"
The userData key a see-through object names its TransparentMedium
under (@voxelize/particles writes the same key on its soft layers).
TRANSPARENT_OVER_FLUID_RENDER_ORDER
• Const TRANSPARENT_OVER_FLUID_RENDER_ORDER: number
The part of a blended see-through mesh (glass) in front of the water
draws here, after the water and the see-through effects in the camera's
medium: water composites a copy of everything drawn before it, so a pane
drawn first is painted over by the pool behind it. The part behind the
nearest water face stays at TRANSPARENT_RENDER_ORDER, where that
copy sees it; which part is which is decided per pixel (WaterDepthPass).
Layers a host draws at whole steps above
TRANSPARENT_FLUID_RENDER_ORDER (rain) still draw after both.
TRANSPARENT_RENDER_ORDER
• Const TRANSPARENT_RENDER_ORDER: 100000
TUFTS_FACE_NAME
• Const TUFTS_FACE_NAME: "voxelize:tufts"
The face name of a chunk geometry holding a block's tufts
(Block.tufts), apart from its cube. Mirrors the mesher's
TUFTS_FACE_NAME.
UNDERSIDE_CRITICAL_COS
• Const UNDERSIDE_CRITICAL_COS: number
Cosine of the critical angle, from straight up, seen from below.
UNHANDLED_METHOD_REPLY
• Const UNHANDLED_METHOD_REPLY: "vox-builtin:unhandled-method"
The reply a server sends when the world a call reached has no handler
under its name: { method, world, handledBy? }, where handledBy names
the worlds on the same server that do handle it.
UNREADABLE_TEXELS
• Const UNREADABLE_TEXELS: Readonly<TexelClasses>
What a surface whose pixels cannot be read is taken to hold: both.
VOLUMETRIC_CLOUD_MAX_LAYERS
• Const VOLUMETRIC_CLOUD_MAX_LAYERS: 2
VOXELIZE_BUILTIN_RELAY_EVENT
• Const VOXELIZE_BUILTIN_RELAY_EVENT: "vox-builtin:relay"
The lane for peer effects: see Events.emitRelayed. The server must
open each name with World::relay_client_event.
VOXELIZE_BUILTIN_SOUND_EFFECT_EVENT
• Const VOXELIZE_BUILTIN_SOUND_EFFECT_EVENT: "vox-builtin:sound-effect"
VOXEL_NEIGHBORS
• Const VOXEL_NEIGHBORS: number[][]
WATER_DEPTH_BIAS_BLOCKS
• Const WATER_DEPTH_BIAS_BLOCKS: 0.02
How far behind a water face, in blocks, a pane fragment has to lie to count as behind it: a pane face flush with a water face (a tank's inner wall) stays in front of the water it holds.
WATER_DEPTH_DRAWN
• Const WATER_DEPTH_DRAWN: 2
WATER_DEPTH_DRY
• Const WATER_DEPTH_DRY: 1
WATER_DEPTH_SIDE_BEHIND
• Const WATER_DEPTH_SIDE_BEHIND: 1
WATER_DEPTH_SIDE_FRONT
• Const WATER_DEPTH_SIDE_FRONT: 2
WATER_DEPTH_SIDE_OFF
• Const WATER_DEPTH_SIDE_OFF: 0
What a blended see-through fragment does with the water's depth
(ChunkMaterial.waterDepthSide, see WaterDepthPass): nothing, keep only
what lies behind the nearest water face, or only what lies in front of it.
WATER_DEPTH_UNKNOWN
• Const WATER_DEPTH_UNKNOWN: 0
What the water's depth holds for a render (waterDepthState): nothing
drawn for it (every pane fragment counts as behind the water, the order
from before the depth existed), no water near any pane in view (every
fragment is in front), or the depth of the water near the panes in view.
WATER_OPTICS
• Const WATER_OPTICS: Readonly<{ aboveSurfaceScatterDepthScale: 0.3 = 0.3; airSideFaceAlphaScale: 0.42 = 0.42; airSideFaceGlossScale: 0 = 0.0; airSideFaceRefractionTintScale: 0.3 = 0.3; airSideFaceTintMix: 0.85 = 0.85; baseWaveFadeEndBlocks: 256 = 256; baseWaveFadeStartBlocks: 144 = 144; bedCausticDepthFalloff: 0.08 = 0.08; bedCausticStrength: 2.4 = 2.4; bodySurfaceSearchRadius: 32 = 32; bodySurfaceSearchVoxels: 4096 = 4096; causticDepthFalloff: 0.7 = 0.7; causticLensSlope: 0.1 = 0.1; causticStrength: 0.35 = 0.35; crestHighlightFull: 0.95 = 0.95; crestHighlightStart: 0.62 = 0.62; deepSurfaceClearDepth: 3 = 3; deepSurfaceExtinction: 0.08 = 0.08; deepSurfaceScatterScale: { blue: number = 0.62; green: number = 0.42; red: number = 0.35 } ; depthSmoothingSpeed: 7 = 7; distantFresnelFactor: 0.55 = 0.55; downwellingExtinction: { blue: number = 0.038; green: number = 0.055; red: number = 0.14 } ; enclosedReflectance: 0.25 = 0.25; enclosedSheenStrength: 0.5 = 0.5; enclosedTintFloor: 0.25 = 0.25; floorAbsorptionMaxDepth: 4 = 4; floorAbsorptionPathScale: 1.6 = 1.6; flowBandSpeed: 6.5 = 6.5; flowCrestSpacingBlocks: 1.5 = 1.5; flowSlopeAmplitude: 0.09 = 0.09; flowStreakStrength: 0.4 = 0.4; fluidStageDropoff: 0.1 = 0.1; fluidSurfaceHeight: 0.875 = 0.875; fresnelAlphaStrength: 0.65 = 0.65; grazingBumpKeep: 0.3 = 0.3; lightFilterFloor: 0.04 = 0.04; maxSurfaceScanBlocks: 96 = 96; nightScatterFloor: 0.06 = 0.06; nightViewExtinctionBoost: 3.5 = 3.5; paneFallbackPathBlocks: 3 = 3; paneMaxPathBlocks: 48 = 48; paneViewExtinctionScale: 0.28 = 0.28; pocketRoofScanBlocks: 16 = 16; pocketSurfaceSearchVoxels: 512 = 512; reflectionFoldbackExponent: 8 = 8; reflectionFoldbackStrength: 0.5 = 0.5; refractedSurfaceAlphaFloor: 0.8 = 0.8; refractionFullStrengthCos: 0.85 = 0.85; refractionGrazingCutoffCos: 0.3 = 0.3; refractionMaxDrawingBufferPixels: 8000000 = 8_000_000; refractionSlopeScale: 2 = 2.0; refractiveIndex: 1.333 = 1.333; rippleFadeEndBlocks: 96 = 96; rippleFadeStartBlocks: 48 = 48; ripplePatchFloor: 0.3 = 0.3; scatterFillBase: 0.03 = 0.03; scatterFillSunStrength: 0.2 = 0.2; shallowScatterDensity: 0.5 = 0.5; shallowScatterMaxMix: 0.35 = 0.35; skyExposureFull: number ; skyExposureNone: number ; skyFadeExtinction: 0.1 = 0.1; specularBroadBaseStrength: 0.04 = 0.04; specularBroadTopStrength: 0.06 = 0.06; specularMediumStrength: 0.12 = 0.12; submergedWallAlphaScale: 0.55 = 0.55; submersionFallSpeed: 11 = 11; submersionRiseSpeed: 16 = 16; sunGlintFarStartCos: 0.95 = 0.95; sunGlintFarStrength: 0.3 = 0.3; sunGlintFullCos: 0.9998 = 0.9998; sunGlintStartCos: 0.996 = 0.996; sunGlintStrength: 0.9 = 0.9; surfaceAbsorptionScale: 0.55 = 0.55; surfaceAlphaFloor: 0.58 = 0.58; surfaceNormalLayers: { bump: number = 0.05; drift: number[] ; rotation: number = 0.0; stretch: number[] ; tileBlocks: number = 40 }[] ; surfaceNormalTexture: { anisotropy: number = 4; gain: number = 0.5; latticePeriod: number = 4; octaves: number = 2; ridgeSharpness: number = 1.3; seed: number = 1337; size: number = 256 } ; surfaceScatterColor: "#37b6c5" = "#37b6c5"; undersideCleanSoftness: 0.22 = 0.22; undersideDistortion: 0.55 = 0.55; undersideFilmScale: 1.3 = 1.3; undersideGlitterCos: 0.9985 = 0.9985; undersideGlitterStrength: 1.6 = 1.6; undersideMirrorOpacity: 0.95 = 0.95; undersideMirrorScale: 1.15 = 1.15; undersideReflectionRipple: 0.14 = 0.14; undersideReflectionScale: 1.35 = 1.35; undersideRippleKeep: 0.45 = 0.45; undersideRippleShade: 0.08 = 0.08; undersideSceneGrazingShare: 0.6 = 0.6; undersideSceneTransmit: 0.85 = 0.85; undersideShallowBedDepth: 4 = 4; undersideShallowBedLift: 0.55 = 0.55; undersideShimmerStrength: 0.05 = 0.05; undersideTransmitFalloff: 2 = 2; undersideTransmitOverhead: 0.55 = 0.55; undersideWebStrength: 0.55 = 0.55; undersideWindowGain: 1.25 = 1.25; undersideWindowOpacity: 0.93 = 0.93; undersideWindowRippleKeep: 0.8 = 0.8; undersideWindowSoftness: 0.12 = 0.12; underwaterInScatterTilt: 0.35 = 0.35; viewExtinctionScale: 0.22 = 0.22; wallPathBlocks: 1 = 1.0; waterlineFadeDepth: 0.12 = 0.12; wetFloorDarken: 0.8 = 0.8 }>
The single source of truth for how water absorbs and scatters light.
Every underwater visual — fog color and density, terrain and entity light attenuation, sky dome fading, first-person prop tinting — is derived from these values so the whole scene stays physically coherent.
WATER_PANE_EXTINCTION
• Const WATER_PANE_EXTINCTION: WaterChannelCoefficients
Extinction along the run of water seen through a tank window.
WATER_SURFACE_SCATTER_COLOR
• Const WATER_SURFACE_SCATTER_COLOR: Color
WATER_VIEW_EXTINCTION
• Const WATER_VIEW_EXTINCTION: WaterChannelCoefficients
WideBranchBits
• Const WideBranchBits: Object
The state wide branch voxels keep in raw bits 16-23. Mirrors
WideBranchBits in the mesher crate.
Type declaration
| Name | Type | Description |
|---|---|---|
isCut | (raw: number) => boolean | - |
shellOffset | (raw: number) => [number, number] | - |
size | (raw: number) => number | - |
WideBranchSection
• Const WideBranchSection: Object
A branch section wider than one voxel: one square tube reaching radius
texels each way from the axis through its core cell's centre, cut into
the cells it covers. Mirrors WideBranchSection in the mesher crate.
Type declaration
| Name | Type |
|---|---|
cellBoxes | (radius: number, texelsPerBlock: number, da: number, db: number) => [number, number, number, number][] |
reach | (radius: number, texelsPerBlock: number) => number |
span | (radius: number, texelsPerBlock: number, d: number) => [number, number] |
Y_ROT_MAP
• Const Y_ROT_MAP: [number, number][] = []
A rotational map used to get the closest y-rotation representation to a y-rotation value.
Rotation value -> index
Y_ROT_MAP_EIGHT
• Const Y_ROT_MAP_EIGHT: [number, number][] = []
Y_ROT_MAP_FOUR
• Const Y_ROT_MAP_FOUR: [number, number][] = []
Y_ROT_SEGMENTS
• Const Y_ROT_SEGMENTS: 16
The amount of Y-rotation segments should be allowed for y-rotatable blocks. In other words, the amount of times the block can be rotated around the y-axis within 360 degrees.
The accepted Y-rotation values will be from 0 to Y_ROTATION_SEGMENTS - 1.
artFunctions
• Const artFunctions: Object
A preset of art functions to draw on canvas boxes.
Type declaration
| Name | Type |
|---|---|
drawCrown | ArtFunction |
drawMoon | (moonRadius: number, moonColor: string, phase: number) => (context: CanvasRenderingContext2D, canvas: HTMLCanvasElement) => void |
drawStars | (starCount: number, starColors: string[], seed?: number) => (context: CanvasRenderingContext2D, canvas: HTMLCanvasElement) => void |
drawSun | (sunRadius: number, sunColor: string) => (context: CanvasRenderingContext2D, canvas: HTMLCanvasElement) => void |