@glboost/babylon
v0.1.1
Published
Babylon.js helpers for GLBoost assets: point the Draco and meshopt decoders at the CDN and load containers with a retry while a variant is still optimizing.
Maintainers
Readme
@glboost/babylon
Babylon.js helpers for models hosted on GLBoost: point Babylon's Draco and meshopt decoders at the files the CDN already serves, and load assets with a retry while a variant is still being optimized (the CDN answers 202), with a callback when it served a fallback variant.
npm install @glboost/babylon @babylonjs/core @babylonjs/loadersimport { configureGLBoost, loadGLBoostAsset } from '@glboost/babylon';
configureGLBoost(); // once: Draco and meshopt decoders from cdn.glboost.com
const container = await loadGLBoostAsset(scene, 'abcdefghjkmn', {
preset: 'gpu',
onFallback: ({ served }) => console.log('serving', served, 'until gpu is ready'),
});
container.addAllToScene();KTX2 keeps Babylon's own transcoders (they are not the files GLBoost hosts); pass
configureGLBoost({ ktx2: { urls } }) if you host them yourself. assetUrl(id, { preset, spec, v })
builds delivery URLs and signedAssetUrl(…) signs them (server-side only).
Docs: https://glboost.com/docs/loaders
