Using it in three.js
In three.js, load GLB with GLTFLoader from three/addons; add DRACOLoader or KTX2Loader only if a file uses those extensions.
- Distance LOD:
THREE.LODwithlod.addLevel(mesh, distance)for LOD0–LOD3; it switches levels by camera distance every frame. - Forests:
InstancedMeshdraws thousands of copies in one draw call, andBatchedMeshmixes several tree variations.THREE.LODdoes not apply per instance, so group instances by LOD per chunk yourself. - Leaves: glTF alphaMode MASK becomes
material.alphaTest, and double-sided materials getside: THREE.DoubleSideautomatically. - Collision mesh: keep it invisible and pass it to a physics library such as Rapier or cannon-es.
Works with both WebGLRenderer and WebGPURenderer.


