import {_testFinish, _testStart, AssetExporterPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe' import {GLTFDracoExportPlugin, GLTFSpecGlossinessConverterPlugin} from '@threepipe/plugin-gltf-transform' const viewer = new ThreeViewer({ canvas: document.getElementById('mcanvas') as HTMLCanvasElement, dropzone: { addOptions: { disposeSceneObjects: true, }, }, msaa: true, }) async function init() { viewer.addPluginSync(LoadingScreenPlugin) viewer.addPluginSync(AssetExporterPlugin) viewer.addPluginSync(GLTFDracoExportPlugin) viewer.addPluginSync(GLTFSpecGlossinessConverterPlugin) // Note: see asset-exporter-plugin example as well // load obj + mtl await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr') const model = await viewer.load('https://asset-samples.threepipe.org/tests/SpecGlossVsMetalRough.glb', { autoCenter: true, autoScale: true, confirmSpecGlossConversion: false, // prevents the confirmation dialog }) if (!model) { console.error('Unable to load model') return } } _testStart() init().finally(_testFinish)