threepipe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

script.ts 864B

123456789101112131415161718192021222324252627282930
  1. import {
  2. _testFinish,
  3. _testStart,
  4. ChromaticAberrationPlugin,
  5. IObject3D,
  6. LoadingScreenPlugin,
  7. ThreeViewer,
  8. } from 'threepipe'
  9. import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
  10. async function init() {
  11. const viewer = new ThreeViewer({
  12. canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
  13. renderScale: 'auto',
  14. plugins: [LoadingScreenPlugin],
  15. })
  16. viewer.addPluginSync(ChromaticAberrationPlugin)
  17. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  18. await viewer.load<IObject3D>('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf')
  19. const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
  20. ui.setupPluginUi(ChromaticAberrationPlugin)
  21. }
  22. _testStart()
  23. init().finally(_testFinish)