voxolith

ServeSceneOptions

Options for serveScene.

Defined in: engine/src/worker/scene.ts:137

Properties

PropertyTypeDescriptionDefined in
cache?string | ServeSceneCacheOptionsKeep encodings and bakes in IndexedDB under this database name (openSceneCache), and serve them from there next time. Off by default; leave it off in development, where the worker URL does not change with the code. The object form adds a size cap and compression (SceneCacheOptions); inspect and clear it from the main thread with openSceneCacheControls. - A bake is looked up by a digest of its input and of the placement data of every model it names, so it needs nothing from the host. - An encoding is looked up by the source's identity: the cacheKey the host gives (SceneEncodeOptions.cacheKey, e.g. GeneratorPool.modelKey), or with hashKey a hash of the source's bytes. Without either it is not cached. Opening the cache deletes every entry stored under another salt (an older build of this worker), so give each worker script its own database name, and not the model cache's. A maxBytes that is not a positive finite number makes serveScene throw; doubtful ones warn (SceneCacheOptions.maxBytes).engine/src/worker/scene.ts:159
scope?SceneScopeThe worker global (default self).engine/src/worker/scene.ts:139

On this page