UNPKG

three-virtual-geometry

Version:

Virtual geometry for three.js WebGPU: automatic cluster LOD and GPU-driven culling for billions of triangles. Independent implementation, not affiliated with Epic Games.

22 lines (21 loc) • 1.35 kB
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh.js'; /** Bumped whenever the container layout or an encoding changes; older readers reject newer files. */ export declare const VG_FORMAT_VERSION = 1; export interface VirtualMeshEncodeOptions { /** Store `indices` instead of rebuilding it from the meshlet arrays on decode. Default false. */ keepIndices?: boolean; /** Lossless compression with meshoptimizer's codecs. Default true; false stores every array uncompressed. */ compress?: boolean; /** * Also deflate fields where that makes them smaller (about 30% smaller files, about 2x slower decoding). * Default true; ignored where `CompressionStream` is unavailable. The IndexedDB cache turns it off. */ deflate?: boolean; } export declare class VirtualMeshFormatError extends Error { constructor(message: string); } export declare function encodeVirtualMesh(data: VirtualMeshData, options?: VirtualMeshEncodeOptions): Promise<Uint8Array>; export declare function decodeVirtualMesh(input: ArrayBuffer | ArrayBufferView): Promise<VirtualMeshData>; /** Fetches and decodes a baked `.vgeo` file, or decodes bytes that are already in memory. */ export declare function loadVirtualMesh(source: string | URL | ArrayBuffer | ArrayBufferView, init?: RequestInit): Promise<VirtualMeshData>;