threepipe
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

plugin-tweakpane-editor.md 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ---
  2. prev:
  3. text: '@threepipe/plugin-blueprintjs'
  4. link: './plugin-blueprintjs'
  5. next:
  6. text: '@threepipe/plugin-configurator'
  7. link: './plugin-configurator'
  8. ---
  9. # @threepipe/plugin-tweakpane-editor
  10. Tweakpane Editor Plugin for ThreePipe
  11. [//]: # (todo: image)
  12. [Example](https://threepipe.org/examples/#tweakpane-editor/) —
  13. [Source Code](https://github.com/repalash/threepipe/blob/master/plugins/tweakpane-editor/src/TweakpaneEditorPlugin.ts) —
  14. [API Reference](https://threepipe.org/plugins/tweakpane-editor/docs/classes/TweakpaneEditorPlugin.html)
  15. [![NPM Package](https://img.shields.io/npm/v/@threepipe/plugin-tweakpane-editor.svg)](https://www.npmjs.com/package/@threepipe/plugin-tweakpane-editor)
  16. ```bash
  17. npm install @threepipe/plugin-tweakpane-editor
  18. ```
  19. `TweakpaneEditorPlugin` uses `TweakpaneUiPlugin` and other custom ui to create an editor for editing viewer, plugins, model and material configurations in the browser.
  20. ```typescript
  21. import {IObject3D, ThreeViewer, TonemapPlugin} from 'threepipe'
  22. import {TweakpaneEditorPlugin} from '@threepipe/plugin-tweakpane-editor'
  23. const viewer = new ThreeViewer({...})
  24. viewer.addPluginSync(new TweakpaneUiPlugin(true))
  25. const editor = viewer.addPluginSync(new TweakpaneEditorPlugin())
  26. // Add some plugins to the viewer
  27. await viewer.addPlugins([
  28. new ViewerUiConfigPlugin(),
  29. // new SceneUiConfigPlugin(), // this is already in ViewerUiPlugin
  30. new DepthBufferPlugin(HalfFloatType, true, true),
  31. new NormalBufferPlugin(HalfFloatType, false),
  32. new RenderTargetPreviewPlugin(false),
  33. ])
  34. // Load the plugin UI in the editor and tweakpane ui with categories.
  35. editor.loadPlugins({
  36. ['Viewer']: [ViewerUiConfigPlugin, SceneUiConfigPlugin, DropzonePlugin, FullScreenPlugin],
  37. ['GBuffer']: [DepthBufferPlugin, NormalBufferPlugin],
  38. ['Post-processing']: [TonemapPlugin],
  39. ['Debug']: [RenderTargetPreviewPlugin],
  40. })
  41. ```