Parameters for optimizeSceneModel.

interface OptimizeSceneModelParams {
    maxPrimitives?: number;
    maxVertices?: number;
    sceneModel: SceneModel;
}

Properties

maxPrimitives?: number

Maximum primitive count per SceneGeometry — triangles for triangle-indexed geometries (Triangles / Solid / Surface), lines for Lines, etc. Geometries above this are split.

Default 32768 — comfortable for a single GPU batch while still giving the renderer scope to coalesce many objects together.

maxVertices?: number

Maximum vertex count per SceneGeometry. Geometries above this threshold are split (see splitSceneGeometry) into two, and the resulting pieces are re-evaluated; the recursion terminates once every piece is at or below both thresholds.

Default 65535 — one less than the Uint16 quantisation cap, so each piece's positionsCompressed slots cleanly into a u16 index space.

sceneModel: SceneModel

SceneModel to optimise. Must be populated (geometries, meshes, objects created).