Skip to content

Class: SectionMesh ​

Defined in: packages/minerender/src/world/SectionMesh.ts:185

Merged terrain geometry and atlas pages for one 16×16×16 section. Owns its generated render resources.

Extends ​

  • Group

Methods ​

dispose() ​

ts
dispose(): void;

Defined in: packages/minerender/src/world/SectionMesh.ts:268

Frees the GPU-related resources allocated by this instance.

Returns ​

void

Remarks ​

Call this method whenever this instance is no longer used in your app. Geometries, materials and textures are potentially shared with other 3D objects and must be disposed of separately.

Overrides ​

ts
Group.dispose

getBlockIndex() ​

ts
getBlockIndex(hit): number | undefined;

Defined in: packages/minerender/src/world/SectionMesh.ts:191

Returns the owning section cell for a triangle hit on this mesh's merged geometry.

Parameters ​

ParameterType
hitIntersection

Returns ​

number | undefined


build() ​

ts
static build(
   entries, 
   maxAtlasSize?, 
   fluids?, 
   lighting?
): SectionMesh;

Defined in: packages/minerender/src/world/SectionMesh.ts:202

Builds section-local meshes from visible quads. maxAtlasSize limits each atlas dimension in pixels.

Parameters ​

ParameterTypeDefault value
entriesreadonly SectionMeshEntry[]undefined
maxAtlasSizenumber2048
fluids?SectionFluidsundefined
lighting?Pick<SectionGeometryInput, "light" | "ambientLight" | "ambientOcclusion">undefined

Returns ​

SectionMesh


buildAsync() ​

ts
static buildAsync(
   entries, 
   maxAtlasSize?, 
   fluids?, 
   lighting?
): Promise<SectionMesh>;

Defined in: packages/minerender/src/world/SectionMesh.ts:209

Builds section-local meshes in a browser worker when available, with synchronous fallback.

Parameters ​

ParameterTypeDefault value
entriesreadonly SectionMeshEntry[]undefined
maxAtlasSizenumber2048
fluids?SectionFluidsundefined
lighting?Pick<SectionGeometryInput, "light" | "ambientLight" | "ambientOcclusion">undefined

Returns ​

Promise<SectionMesh>

Inherited three.js API ​

Members inherited from Group are documented by three.js. MineRender overrides are listed above.