| 123456789101112131415161718192021222324252627282930 |
- import {
- _testFinish,
- _testStart,
- ChromaticAberrationPlugin,
- IObject3D,
- LoadingScreenPlugin,
- ThreeViewer,
- } from 'threepipe'
- import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
-
- async function init() {
-
- const viewer = new ThreeViewer({
- canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
- renderScale: 'auto',
- plugins: [LoadingScreenPlugin],
- })
-
- viewer.addPluginSync(ChromaticAberrationPlugin)
-
- await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
- await viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf')
-
- const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
- ui.setupPluginUi(ChromaticAberrationPlugin)
-
- }
-
- _testStart()
- init().finally(_testFinish)
|