Procházet zdrojové kódy

Add loading screen to all examples.

master
Palash Bansal před 2 roky
rodič
revize
1a4fdde0df
Žádný účet není propojen s e-mailovou adresou tvůrce revize
94 změnil soubory, kde provedl 396 přidání a 112 odebrání
  1. 6
    2
      examples/3dm-to-glb/script.ts
  2. 2
    1
      examples/ambient-light/script.ts
  3. 2
    1
      examples/basic-svg-renderer-plugin/script.ts
  4. 2
    2
      examples/blend-load/index.html
  5. 2
    1
      examples/blueprintjs-ui-plugin/script.ts
  6. 2
    1
      examples/camera-uiconfig/script.ts
  7. 11
    1
      examples/camera-view-plugin/script.ts
  8. 2
    1
      examples/canvas-snapshot-plugin/script.ts
  9. 3
    1
      examples/chromatic-aberration-plugin/script.ts
  10. 9
    1
      examples/clearcoat-tint-plugin/script.ts
  11. 3
    1
      examples/contact-shadow-ground-plugin/script.ts
  12. 11
    1
      examples/custom-bump-map-plugin/script.ts
  13. 3
    0
      examples/custom-pipeline/script.ts
  14. 2
    0
      examples/depth-buffer-plugin/script.ts
  15. 2
    2
      examples/device-orientation-controls-plugin/script.ts
  16. 2
    1
      examples/directional-light/script.ts
  17. 2
    1
      examples/dropzone-plugin/script.ts
  18. 2
    1
      examples/editor-view-widget-plugin/script.ts
  19. 10
    1
      examples/extra-importer-plugins/script.ts
  20. 3
    1
      examples/filmic-grain-plugin/script.ts
  21. 2
    0
      examples/fragment-clipping-extension-plugin/script.ts
  22. 11
    1
      examples/frame-fade-plugin/script.ts
  23. 3
    1
      examples/fullscreen-plugin/script.ts
  24. 2
    0
      examples/gbuffer-plugin/script.ts
  25. 9
    2
      examples/geometry-generator-plugin/script.ts
  26. 2
    1
      examples/geometry-uv-preview/script.ts
  27. 2
    1
      examples/glb-export/script.ts
  28. 2
    1
      examples/gltf-animation-page-scroll/script.ts
  29. 2
    1
      examples/gltf-animation-plugin/script.ts
  30. 2
    1
      examples/gltf-camera-animation/script.ts
  31. 9
    2
      examples/gltf-khr-material-variants-plugin/script.ts
  32. 3
    1
      examples/gltf-load/script.ts
  33. 2
    1
      examples/gltf-transmission-test-msaa/script.ts
  34. 2
    1
      examples/gltf-transmission-test/script.ts
  35. 11
    1
      examples/half-float-hdr-test/script.ts
  36. 2
    1
      examples/hdr-to-exr/script.ts
  37. 2
    2
      examples/hdri-ground-plugin/script.ts
  38. 2
    1
      examples/hemisphere-light/script.ts
  39. 5
    2
      examples/html-js-sample/index.html
  40. 11
    1
      examples/image-load/script.ts
  41. 2
    1
      examples/image-snapshot-export/script.ts
  42. 3
    1
      examples/interaction-prompt-plugin/script.ts
  43. 2
    0
      examples/ktx-load/script.ts
  44. 2
    1
      examples/ktx2-load/script.ts
  45. 2
    1
      examples/material-uiconfig/script.ts
  46. 9
    2
      examples/meshopt-simplify-modifier-plugin/script.ts
  47. 2
    1
      examples/multi-viewer-test/script.ts
  48. 9
    1
      examples/noise-bump-material-plugin/script.ts
  49. 2
    0
      examples/normal-buffer-plugin/script.ts
  50. 4
    2
      examples/obj-to-glb/script.ts
  51. 2
    1
      examples/object-uiconfig/script.ts
  52. 2
    1
      examples/object3d-generator-plugin/script.ts
  53. 2
    1
      examples/object3d-widgets-plugin/script.ts
  54. 2
    1
      examples/parallax-mapping-plugin/script.ts
  55. 2
    1
      examples/parallel-asset-import/script.ts
  56. 2
    1
      examples/picking-plugin/script.ts
  57. 2
    1
      examples/ply-load/script.ts
  58. 13
    2
      examples/pmat-material-export/script.ts
  59. 2
    1
      examples/point-light/script.ts
  60. 2
    2
      examples/pointer-lock-controls-plugin/script.ts
  61. 13
    1
      examples/popmotion-plugin/script.ts
  62. 2
    1
      examples/progressive-hdr-shadows-exp/script.ts
  63. 2
    0
      examples/progressive-plugin/script.ts
  64. 6
    3
      examples/react-js-sample/index.html
  65. 5
    3
      examples/react-jsx-sample/index.html
  66. 4
    2
      examples/react-tsx-sample/script.tsx
  67. 2
    1
      examples/rect-area-light/script.ts
  68. 2
    0
      examples/render-target-export/script.ts
  69. 2
    0
      examples/render-target-preview/script.ts
  70. 2
    1
      examples/rhino3dm-load/script.ts
  71. 2
    1
      examples/scene-uiconfig/script.ts
  72. 2
    1
      examples/simplify-modifier-plugin/script.ts
  73. 4
    2
      examples/splat-load/index.html
  74. 2
    1
      examples/spot-light/script.ts
  75. 10
    1
      examples/ssaa-plugin/script.ts
  76. 10
    2
      examples/ssao-plugin/script.ts
  77. 2
    1
      examples/stl-load/script.ts
  78. 5
    3
      examples/svelte-sample/App.svelte
  79. 2
    1
      examples/svg-geometry-playground/script.ts
  80. 2
    2
      examples/three-first-person-controls-plugin/script.ts
  81. 14
    3
      examples/three-svg-renderer-plugin/script.ts
  82. 10
    1
      examples/tonemap-plugin/script.ts
  83. 9
    2
      examples/transform-animation-plugin/script.ts
  84. 10
    1
      examples/transform-controls-plugin/script.ts
  85. 2
    1
      examples/tweakpane-ui-plugin/script.ts
  86. 11
    1
      examples/uint8-rgbm-hdr-test/script.ts
  87. 2
    1
      examples/usdz-load/script.ts
  88. 2
    1
      examples/viewer-uiconfig/script.ts
  89. 3
    1
      examples/vignette-plugin/script.ts
  90. 2
    1
      examples/virtual-camera/script.ts
  91. 2
    1
      examples/virtual-cameras-plugin/script.ts
  92. 6
    3
      examples/vue-html-sample/index.html
  93. 5
    2
      examples/vue-sfc-sample/script.vue
  94. 2
    1
      examples/z-prepass/index.html

+ 6
- 2
examples/3dm-to-glb/script.ts Zobrazit soubor

import {_testFinish, downloadBlob, IObject3D, Rhino3dmLoadPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, downloadBlob, IObject3D, LoadingScreenPlugin, Rhino3dmLoadPlugin, ThreeViewer} from 'threepipe'


const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement, msaa: true})
const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true,
plugins: [LoadingScreenPlugin],
})


async function init() { async function init() {



+ 2
- 1
examples/ambient-light/script.ts Zobrazit soubor

AmbientLight2, AmbientLight2,
Box3B, Box3B,
IObject3D, IObject3D,
LoadingScreenPlugin,
Mesh, Mesh,
Object3DWidgetsPlugin, Object3DWidgetsPlugin,
PhysicalMaterial, PhysicalMaterial,
autoSetEnvironment: true, // when hdr/exr is dropped autoSetEnvironment: true, // when hdr/exr is dropped
}, },
}, },
plugins: [Object3DWidgetsPlugin],
plugins: [Object3DWidgetsPlugin, LoadingScreenPlugin],
}) })


// viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10)) // viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10))

+ 2
- 1
examples/basic-svg-renderer-plugin/script.ts Zobrazit soubor

import {_testFinish, DirectionalLight2, ThreeViewer} from 'threepipe'
import {_testFinish, DirectionalLight2, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
import {BasicSVGRendererPlugin} from '@threepipe/plugin-svg-renderer' import {BasicSVGRendererPlugin} from '@threepipe/plugin-svg-renderer'


canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: false, msaa: false,
tonemap: false, tonemap: false,
plugins: [LoadingScreenPlugin],
}) })


viewer.scene.mainCamera.controls!.enableDamping = false viewer.scene.mainCamera.controls!.enableDamping = false

+ 2
- 2
examples/blend-load/index.html Zobrazit soubor

</style> </style>
<script type="module" src="../examples-utils/simple-code-preview.mjs"></script> <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
<script id="example-script" type="module"> <script id="example-script" type="module">
import {_testFinish, ThreeViewer} from 'threepipe'
import {_testFinish, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {BlendLoadPlugin} from '@threepipe/plugin-blend-importer' import {BlendLoadPlugin} from '@threepipe/plugin-blend-importer'


const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas')}) const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas')})
viewer.addPluginsSync([BlendLoadPlugin])
viewer.addPluginsSync([BlendLoadPlugin, LoadingScreenPlugin])


async function init() { async function init() {



+ 2
- 1
examples/blueprintjs-ui-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer, TonemapPlugin} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer, TonemapPlugin} from 'threepipe'
import {BlueprintJsUiPlugin} from '@threepipe/plugin-blueprintjs' import {BlueprintJsUiPlugin} from '@threepipe/plugin-blueprintjs'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new BlueprintJsUiPlugin()) const ui = viewer.addPluginSync(new BlueprintJsUiPlugin())

+ 2
- 1
examples/camera-uiconfig/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 11
- 1
examples/camera-view-plugin/script.ts Zobrazit soubor

import {_testFinish, CameraView, CameraViewPlugin, EasingFunctions, ThreeViewer, Vector3} from 'threepipe'
import {
_testFinish,
CameraView,
CameraViewPlugin,
EasingFunctions,
LoadingScreenPlugin,
ThreeViewer,
Vector3,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'




const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })
const cameraViewPlugin = viewer.addPluginSync(CameraViewPlugin) const cameraViewPlugin = viewer.addPluginSync(CameraViewPlugin)
console.log(cameraViewPlugin) console.log(cameraViewPlugin)

+ 2
- 1
examples/canvas-snapshot-plugin/script.ts Zobrazit soubor

import {_testFinish, CanvasSnapshotPlugin, isWebpExportSupported, ThreeViewer} from 'threepipe'
import {_testFinish, CanvasSnapshotPlugin, isWebpExportSupported, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
renderScale: 'auto', renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 3
- 1
examples/chromatic-aberration-plugin/script.ts Zobrazit soubor

import {_testFinish, ChromaticAberrationPlugin, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, ChromaticAberrationPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(ChromaticAberrationPlugin) viewer.addPluginSync(ChromaticAberrationPlugin)

+ 9
- 1
examples/clearcoat-tint-plugin/script.ts Zobrazit soubor

import {_testFinish, ClearcoatTintPlugin, IObject3D, PhysicalMaterial, ThreeViewer} from 'threepipe'
import {
_testFinish,
ClearcoatTintPlugin,
IObject3D,
LoadingScreenPlugin,
PhysicalMaterial,
ThreeViewer,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const clearcoatTint = viewer.addPluginSync(ClearcoatTintPlugin) const clearcoatTint = viewer.addPluginSync(ClearcoatTintPlugin)

+ 3
- 1
examples/contact-shadow-ground-plugin/script.ts Zobrazit soubor

import {_testFinish, ContactShadowGroundPlugin, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, ContactShadowGroundPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(ContactShadowGroundPlugin) viewer.addPluginSync(ContactShadowGroundPlugin)

+ 11
- 1
examples/custom-bump-map-plugin/script.ts Zobrazit soubor

import {_testFinish, CustomBumpMapPlugin, ITexture, Mesh, PhysicalMaterial, PlaneGeometry, ThreeViewer} from 'threepipe'
import {
_testFinish,
CustomBumpMapPlugin,
ITexture,
LoadingScreenPlugin,
Mesh,
PhysicalMaterial,
PlaneGeometry,
ThreeViewer,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const customBump = viewer.addPluginSync(CustomBumpMapPlugin) const customBump = viewer.addPluginSync(CustomBumpMapPlugin)

+ 3
- 0
examples/custom-pipeline/script.ts Zobrazit soubor

DepthBufferPlugin, DepthBufferPlugin,
downloadBlob, downloadBlob,
HalfFloatType, HalfFloatType,
LoadingScreenPlugin,
RenderTargetPreviewPlugin, RenderTargetPreviewPlugin,
ThreeViewer, ThreeViewer,
} from 'threepipe' } from 'threepipe'
msaa: false, msaa: false,
rgbm: true, rgbm: true,
zPrepass: false, zPrepass: false,
plugins: [LoadingScreenPlugin],
renderScale: 'auto',
}) })


async function init() { async function init() {

+ 2
- 0
examples/depth-buffer-plugin/script.ts Zobrazit soubor

DepthBufferPlugin, DepthBufferPlugin,
downloadBlob, downloadBlob,
HalfFloatType, HalfFloatType,
LoadingScreenPlugin,
RenderTargetPreviewPlugin, RenderTargetPreviewPlugin,
ThreeViewer, ThreeViewer,
} from 'threepipe' } from 'threepipe'
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 2
- 2
examples/device-orientation-controls-plugin/script.ts Zobrazit soubor

import {_testFinish, DeviceOrientationControlsPlugin, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, DeviceOrientationControlsPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [DeviceOrientationControlsPlugin],
plugins: [DeviceOrientationControlsPlugin, LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 2
- 1
examples/directional-light/script.ts Zobrazit soubor

Box3B, Box3B,
DirectionalLight2, DirectionalLight2,
IObject3D, IObject3D,
LoadingScreenPlugin,
Mesh, Mesh,
Object3DWidgetsPlugin, Object3DWidgetsPlugin,
PCFSoftShadowMap, PCFSoftShadowMap,
autoSetEnvironment: true, // when hdr/exr is dropped autoSetEnvironment: true, // when hdr/exr is dropped
}, },
}, },
plugins: [Object3DWidgetsPlugin],
plugins: [Object3DWidgetsPlugin, LoadingScreenPlugin],
}) })


// viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10)) // viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10))

+ 2
- 1
examples/dropzone-plugin/script.ts Zobrazit soubor

import {_testFinish, DropzonePlugin, ThreeViewer} from 'threepipe'
import {_testFinish, DropzonePlugin, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
importConfig: true, // import config from file importConfig: true, // import config from file
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr') await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')

+ 2
- 1
examples/editor-view-widget-plugin/script.ts Zobrazit soubor

import {_testFinish, EditorViewWidgetPlugin, IObject3D, ThreeViewer, timeout} from 'threepipe'
import {_testFinish, EditorViewWidgetPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer, timeout} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


viewer.scene.setBackgroundColor(0x151822) viewer.scene.setBackgroundColor(0x151822)

+ 10
- 1
examples/extra-importer-plugins/script.ts Zobrazit soubor

import {_testFinish, GLTFAnimationPlugin, HemisphereLight, ImportAddOptions, IObject3D, ThreeViewer} from 'threepipe'
import {
_testFinish,
GLTFAnimationPlugin,
HemisphereLight,
ImportAddOptions,
IObject3D,
LoadingScreenPlugin,
ThreeViewer,
} from 'threepipe'
import { import {
AMFLoadPlugin, AMFLoadPlugin,
BVHLoadPlugin, BVHLoadPlugin,
disposeSceneObjects: true, disposeSceneObjects: true,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })
viewer.addPluginsSync([ viewer.addPluginsSync([
GLTFAnimationPlugin, GLTFAnimationPlugin,

+ 3
- 1
examples/filmic-grain-plugin/script.ts Zobrazit soubor

import {_testFinish, FilmicGrainPlugin, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, FilmicGrainPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(FilmicGrainPlugin) viewer.addPluginSync(FilmicGrainPlugin)

+ 2
- 0
examples/fragment-clipping-extension-plugin/script.ts Zobrazit soubor

_testFinish, _testFinish,
FragmentClippingExtensionPlugin, FragmentClippingExtensionPlugin,
IObject3D, IObject3D,
LoadingScreenPlugin,
PhysicalMaterial, PhysicalMaterial,
ThreeViewer, ThreeViewer,
Vector4, Vector4,
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const fragmentClipping = viewer.addPluginSync(FragmentClippingExtensionPlugin) const fragmentClipping = viewer.addPluginSync(FragmentClippingExtensionPlugin)

+ 11
- 1
examples/frame-fade-plugin/script.ts Zobrazit soubor

import {_testFinish, BoxGeometry, FrameFadePlugin, Mesh, PhysicalMaterial, ThreeViewer} from 'threepipe'
import {
_testFinish,
BoxGeometry,
FrameFadePlugin,
LoadingScreenPlugin,
Mesh,
PhysicalMaterial,
ThreeViewer,
} from 'threepipe'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })
viewer.addPluginSync(FrameFadePlugin) viewer.addPluginSync(FrameFadePlugin)



+ 3
- 1
examples/fullscreen-plugin/script.ts Zobrazit soubor

import {_testFinish, FullScreenPlugin, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, FullScreenPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'




const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })


const fullScreenPlugin = viewer.addPluginSync(new FullScreenPlugin()) const fullScreenPlugin = viewer.addPluginSync(new FullScreenPlugin())

+ 2
- 0
examples/gbuffer-plugin/script.ts Zobrazit soubor

GBufferPlugin, GBufferPlugin,
HalfFloatType, HalfFloatType,
IObject3D, IObject3D,
LoadingScreenPlugin,
RenderTargetPreviewPlugin, RenderTargetPreviewPlugin,
ThreeViewer, ThreeViewer,
} from 'threepipe' } from 'threepipe'
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
zPrepass: true, zPrepass: true,
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 9
- 2
examples/geometry-generator-plugin/script.ts Zobrazit soubor

import {_testFinish, CameraViewPlugin, Object3DGeneratorPlugin, PickingPlugin, ThreeViewer} from 'threepipe'
import {
_testFinish,
CameraViewPlugin,
LoadingScreenPlugin,
Object3DGeneratorPlugin,
PickingPlugin,
ThreeViewer,
} from 'threepipe'
import {GeometryGeneratorPlugin} from '@threepipe/plugin-geometry-generator' import {GeometryGeneratorPlugin} from '@threepipe/plugin-geometry-generator'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [PickingPlugin, CameraViewPlugin, Object3DGeneratorPlugin],
plugins: [PickingPlugin, CameraViewPlugin, Object3DGeneratorPlugin, LoadingScreenPlugin],
}) })
const generator = viewer.addPluginSync(GeometryGeneratorPlugin) const generator = viewer.addPluginSync(GeometryGeneratorPlugin)



+ 2
- 1
examples/geometry-uv-preview/script.ts Zobrazit soubor

import {_testFinish, GeometryUVPreviewPlugin, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, GeometryUVPreviewPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
rgbm: true, rgbm: true,
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 2
- 1
examples/glb-export/script.ts Zobrazit soubor

import {_testFinish, downloadBlob, IMaterial, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, downloadBlob, IMaterial, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'


const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement, msaa: true}) const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement, msaa: true})


async function init() { async function init() {
viewer.addPluginSync(LoadingScreenPlugin)


// Note: see asset-exporter-plugin example as well // Note: see asset-exporter-plugin example as well



+ 2
- 1
examples/gltf-animation-page-scroll/script.ts Zobrazit soubor

import {_testFinish, GLTFAnimationPlugin, ICamera, ThreeViewer} from 'threepipe'
import {_testFinish, GLTFAnimationPlugin, ICamera, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const gltfAnimation = viewer.addPluginSync(GLTFAnimationPlugin) const gltfAnimation = viewer.addPluginSync(GLTFAnimationPlugin)

+ 2
- 1
examples/gltf-animation-plugin/script.ts Zobrazit soubor

import {_testFinish, GLTFAnimationPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, GLTFAnimationPlugin, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


async function init() { async function init() {


autoSetEnvironment: true, // when hdr is dropped autoSetEnvironment: true, // when hdr is dropped
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


const gltfAnimation = viewer.addPluginSync(GLTFAnimationPlugin) const gltfAnimation = viewer.addPluginSync(GLTFAnimationPlugin)

+ 2
- 1
examples/gltf-camera-animation/script.ts Zobrazit soubor

import {_testFinish, GLTFAnimationPlugin, ICamera, ThreeViewer} from 'threepipe'
import {_testFinish, GLTFAnimationPlugin, ICamera, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


async function init() { async function init() {


autoSetEnvironment: true, // when hdr is dropped autoSetEnvironment: true, // when hdr is dropped
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


const gltfAnimation = viewer.addPluginSync(GLTFAnimationPlugin) const gltfAnimation = viewer.addPluginSync(GLTFAnimationPlugin)

+ 9
- 2
examples/gltf-khr-material-variants-plugin/script.ts Zobrazit soubor

import {_testFinish, GLTFKHRMaterialVariantsPlugin, IObject3D, SSAAPlugin, ThreeViewer} from 'threepipe'
import {
_testFinish,
GLTFKHRMaterialVariantsPlugin,
IObject3D,
LoadingScreenPlugin,
SSAAPlugin,
ThreeViewer,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [SSAAPlugin, GLTFKHRMaterialVariantsPlugin],
plugins: [SSAAPlugin, GLTFKHRMaterialVariantsPlugin, LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 3
- 1
examples/gltf-load/script.ts Zobrazit soubor

import {_testFinish, ThreeViewer} from 'threepipe'
import {_testFinish, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


async function init() { async function init() {


// plugins: [GLTFMeshOptDecodePlugin, KTX2LoadPlugin, GLTFKHRMaterialVariantsPlugin, ...], // plugins: [GLTFMeshOptDecodePlugin, KTX2LoadPlugin, GLTFKHRMaterialVariantsPlugin, ...],
}) })


viewer.addPluginSync(LoadingScreenPlugin)

await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr', { await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr', {
setBackground: true, setBackground: true,
}) })

+ 2
- 1
examples/gltf-transmission-test-msaa/script.ts Zobrazit soubor

import {_testFinish, IObject3D, RenderTargetPreviewPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, RenderTargetPreviewPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
msaa: true, msaa: true,
rgbm: true, rgbm: true,
zPrepass: false, zPrepass: false,
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 2
- 1
examples/gltf-transmission-test/script.ts Zobrazit soubor

import {_testFinish, IObject3D, RenderTargetPreviewPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, RenderTargetPreviewPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
msaa: false, msaa: false,
rgbm: true, rgbm: true,
zPrepass: false, zPrepass: false,
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 11
- 1
examples/half-float-hdr-test/script.ts Zobrazit soubor

import {_testFinish, BoxGeometry, Color, Mesh, PhysicalMaterial, ThreeViewer, TonemapPlugin} from 'threepipe'
import {
_testFinish,
BoxGeometry,
Color,
LoadingScreenPlugin,
Mesh,
PhysicalMaterial,
ThreeViewer,
TonemapPlugin,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
rgbm: false, rgbm: false,
plugins: [LoadingScreenPlugin],
}) })
viewer.scene.backgroundColor = new Color().set('black') viewer.scene.backgroundColor = new Color().set('black')
viewer.getPlugin(TonemapPlugin)!.exposure = 0.04 viewer.getPlugin(TonemapPlugin)!.exposure = 0.04

+ 2
- 1
examples/hdr-to-exr/script.ts Zobrazit soubor

import {_testFinish, downloadBlob, IAsset, ITexture, ThreeViewer} from 'threepipe'
import {_testFinish, downloadBlob, IAsset, ITexture, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement}) const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement})


async function init() { async function init() {
viewer.addPluginSync(LoadingScreenPlugin)


// import a hdr file // import a hdr file
const dataTexture = await viewer.import<ITexture>('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr') const dataTexture = await viewer.import<ITexture>('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')

+ 2
- 2
examples/hdri-ground-plugin/script.ts Zobrazit soubor

import {_testFinish, CameraViewPlugin, HDRiGroundPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, CameraViewPlugin, HDRiGroundPlugin, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
autoSetBackground: true, autoSetBackground: true,
}, },
}, },
plugins: [CameraViewPlugin],
plugins: [CameraViewPlugin, LoadingScreenPlugin],
}) })
const hdriGround = viewer.addPluginSync(HDRiGroundPlugin) const hdriGround = viewer.addPluginSync(HDRiGroundPlugin)



+ 2
- 1
examples/hemisphere-light/script.ts Zobrazit soubor

Box3B, Box3B,
HemisphereLight2, HemisphereLight2,
IObject3D, IObject3D,
LoadingScreenPlugin,
Mesh, Mesh,
Object3DWidgetsPlugin, Object3DWidgetsPlugin,
PhysicalMaterial, PhysicalMaterial,
autoSetEnvironment: true, // when hdr/exr is dropped autoSetEnvironment: true, // when hdr/exr is dropped
}, },
}, },
plugins: [Object3DWidgetsPlugin],
plugins: [Object3DWidgetsPlugin, LoadingScreenPlugin],
}) })


// viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10)) // viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10))

+ 5
- 2
examples/html-js-sample/index.html Zobrazit soubor

<body> <body>
<canvas id="three-canvas" style="width: 800px; height: 600px;"></canvas> <canvas id="three-canvas" style="width: 800px; height: 600px;"></canvas>
<script id="example-script" type="module" data-scripts="./index.html"> <script id="example-script" type="module" data-scripts="./index.html">
// import {ThreeViewer} from 'https://threepipe.org/dist/index.mjs'
import {ThreeViewer} from './../../dist/index.mjs'
// import {ThreeViewer, LoadingScreenPlugin} from 'https://threepipe.org/dist/index.mjs'
import {ThreeViewer, LoadingScreenPlugin} from './../../dist/index.mjs'

const viewer = new ThreeViewer({canvas: document.getElementById('three-canvas')}) const viewer = new ThreeViewer({canvas: document.getElementById('three-canvas')})


viewer.addPluginSync(LoadingScreenPlugin)

// Load an environment map // Load an environment map
const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr') const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
const modelPromise = viewer.load('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', { const modelPromise = viewer.load('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', {

+ 11
- 1
examples/image-load/script.ts Zobrazit soubor

import {_testFinish, ITexture, Mesh, PlaneGeometry, SRGBColorSpace, ThreeViewer, UnlitMaterial} from 'threepipe'
import {
_testFinish,
ITexture,
LoadingScreenPlugin,
Mesh,
PlaneGeometry,
SRGBColorSpace,
ThreeViewer,
UnlitMaterial,
} from 'threepipe'


async function init() { async function init() {


autoSetBackground: false, autoSetBackground: false,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


viewer.scene.setBackgroundColor('#555555') viewer.scene.setBackgroundColor('#555555')

+ 2
- 1
examples/image-snapshot-export/script.ts Zobrazit soubor

import {_testFinish, downloadBlob, isWebpExportSupported, ThreeViewer} from 'threepipe'
import {_testFinish, downloadBlob, isWebpExportSupported, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


// Note: see also: CanvasSnapshotPlugin // Note: see also: CanvasSnapshotPlugin

+ 3
- 1
examples/interaction-prompt-plugin/script.ts Zobrazit soubor

import {_testFinish, InteractionPromptPlugin, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, InteractionPromptPlugin, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })


const interactionPrompt = viewer.addPluginSync(new InteractionPromptPlugin()) const interactionPrompt = viewer.addPluginSync(new InteractionPromptPlugin())

+ 2
- 0
examples/ktx-load/script.ts Zobrazit soubor

_testFinish, _testFinish,
ITexture, ITexture,
KTXLoadPlugin, KTXLoadPlugin,
LoadingScreenPlugin,
Mesh, Mesh,
PlaneGeometry, PlaneGeometry,
SRGBColorSpace, SRGBColorSpace,
dropzone: { dropzone: {
allowedExtensions: ['ktx'], allowedExtensions: ['ktx'],
}, },
plugins: [LoadingScreenPlugin],
}) })
viewer.addPluginSync(KTXLoadPlugin) viewer.addPluginSync(KTXLoadPlugin)



+ 2
- 1
examples/ktx2-load/script.ts Zobrazit soubor

_testFinish, _testFinish,
ITexture, ITexture,
KTX2LoadPlugin, KTX2LoadPlugin,
LoadingScreenPlugin,
Mesh, Mesh,
PlaneGeometry, PlaneGeometry,
SRGBColorSpace, SRGBColorSpace,
dropzone: { dropzone: {
allowedExtensions: ['ktx2'], allowedExtensions: ['ktx2'],
}, },
plugins: [KTX2LoadPlugin],
plugins: [KTX2LoadPlugin, LoadingScreenPlugin],
}) })


viewer.scene.setBackgroundColor('#555555') viewer.scene.setBackgroundColor('#555555')

+ 2
- 1
examples/material-uiconfig/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 9
- 2
examples/meshopt-simplify-modifier-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, MeshOptSimplifyModifierPlugin, PickingPlugin, ThreeViewer} from 'threepipe'
import {
_testFinish,
IObject3D,
LoadingScreenPlugin,
MeshOptSimplifyModifierPlugin,
PickingPlugin,
ThreeViewer,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [PickingPlugin],
plugins: [PickingPlugin, LoadingScreenPlugin],
dropzone: { dropzone: {
addOptions: { addOptions: {
disposeSceneObjects: true, disposeSceneObjects: true,

+ 2
- 1
examples/multi-viewer-test/script.ts Zobrazit soubor

import {_testFinish, ThreeViewer} from 'threepipe'
import {_testFinish, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


const models = [ const models = [
'https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf', 'https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf',
autoSetBackground: true, autoSetBackground: true,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr', { await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr', {

+ 9
- 1
examples/noise-bump-material-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, NoiseBumpMaterialPlugin, PhysicalMaterial, ThreeViewer} from 'threepipe'
import {
_testFinish,
IObject3D,
LoadingScreenPlugin,
NoiseBumpMaterialPlugin,
PhysicalMaterial,
ThreeViewer,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const noiseBump = viewer.addPluginSync(NoiseBumpMaterialPlugin) const noiseBump = viewer.addPluginSync(NoiseBumpMaterialPlugin)

+ 2
- 0
examples/normal-buffer-plugin/script.ts Zobrazit soubor

_testFinish, _testFinish,
downloadBlob, downloadBlob,
HalfFloatType, HalfFloatType,
LoadingScreenPlugin,
NoColorSpace, NoColorSpace,
NormalBufferPlugin, NormalBufferPlugin,
RenderTargetPreviewPlugin, RenderTargetPreviewPlugin,


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 4
- 2
examples/obj-to-glb/script.ts Zobrazit soubor

import {_testFinish, downloadBlob, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, downloadBlob, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement, msaa: true})
const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement, msaa: true,
plugins: [LoadingScreenPlugin],
})


async function init() { async function init() {



+ 2
- 1
examples/object-uiconfig/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 2
- 1
examples/object3d-generator-plugin/script.ts Zobrazit soubor

import { import {
_testFinish, _testFinish,
CameraViewPlugin, CameraViewPlugin,
LoadingScreenPlugin,
Object3DGeneratorPlugin, Object3DGeneratorPlugin,
Object3DWidgetsPlugin, Object3DWidgetsPlugin,
PickingPlugin, PickingPlugin,
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [PickingPlugin, CameraViewPlugin, Object3DWidgetsPlugin, HierarchyUiPlugin],
plugins: [PickingPlugin, CameraViewPlugin, Object3DWidgetsPlugin, HierarchyUiPlugin, LoadingScreenPlugin],
}) })
const generator = viewer.addPluginSync(Object3DGeneratorPlugin) const generator = viewer.addPluginSync(Object3DGeneratorPlugin)



+ 2
- 1
examples/object3d-widgets-plugin/script.ts Zobrazit soubor

import { import {
_testFinish, _testFinish,
CameraViewPlugin, CameraViewPlugin,
LoadingScreenPlugin,
Object3DGeneratorPlugin, Object3DGeneratorPlugin,
Object3DWidgetsPlugin, Object3DWidgetsPlugin,
ThreeViewer, ThreeViewer,
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [CameraViewPlugin, Object3DGeneratorPlugin],
plugins: [CameraViewPlugin, Object3DGeneratorPlugin, LoadingScreenPlugin],
}) })
const widgets = viewer.addPluginSync(Object3DWidgetsPlugin) const widgets = viewer.addPluginSync(Object3DWidgetsPlugin)



+ 2
- 1
examples/parallax-mapping-plugin/script.ts Zobrazit soubor

_testFinish, _testFinish,
BoxGeometry, BoxGeometry,
ITexture, ITexture,
LoadingScreenPlugin,
Mesh, Mesh,
ParallaxMappingPlugin, ParallaxMappingPlugin,
PhysicalMaterial, PhysicalMaterial,
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [new SSAAPlugin(4)],
plugins: [new SSAAPlugin(4), LoadingScreenPlugin],
dropzone: { dropzone: {
addOptions: { addOptions: {
disposeSceneObjects: true, disposeSceneObjects: true,

+ 2
- 1
examples/parallel-asset-import/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: false, msaa: false,
rgbm: true, rgbm: true,
zPrepass: false, zPrepass: false,
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 2
- 1
examples/picking-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, PickingPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, PickingPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const picking = viewer.addPluginSync(PickingPlugin) const picking = viewer.addPluginSync(PickingPlugin)

+ 2
- 1
examples/ply-load/script.ts Zobrazit soubor

import {_testFinish, IObject3D, PLYLoadPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, PLYLoadPlugin, ThreeViewer} from 'threepipe'


async function init() { async function init() {


autoSetBackground: true, autoSetBackground: true,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(PLYLoadPlugin) viewer.addPluginSync(PLYLoadPlugin)

+ 13
- 2
examples/pmat-material-export/script.ts Zobrazit soubor

import {_testFinish, downloadBlob, IMaterial, IObject3D, Mesh, SphereGeometry, ThreeViewer} from 'threepipe'
import {
_testFinish,
downloadBlob,
IMaterial,
IObject3D,
LoadingScreenPlugin,
Mesh,
SphereGeometry,
ThreeViewer,
} from 'threepipe'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'


const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement, msaa: true})
const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas') as HTMLCanvasElement, msaa: true,
plugins: [LoadingScreenPlugin],
})


async function init() { async function init() {



+ 2
- 1
examples/point-light/script.ts Zobrazit soubor

_testFinish, _testFinish,
Box3B, Box3B,
IObject3D, IObject3D,
LoadingScreenPlugin,
Mesh, Mesh,
Object3DWidgetsPlugin, Object3DWidgetsPlugin,
PCFSoftShadowMap, PCFSoftShadowMap,
autoSetEnvironment: true, // when hdr/exr is dropped autoSetEnvironment: true, // when hdr/exr is dropped
}, },
}, },
plugins: [Object3DWidgetsPlugin],
plugins: [Object3DWidgetsPlugin, LoadingScreenPlugin],
}) })


// viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10)) // viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10))

+ 2
- 2
examples/pointer-lock-controls-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, PointerLockControlsPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, PointerLockControlsPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [PointerLockControlsPlugin],
plugins: [PointerLockControlsPlugin, LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 13
- 1
examples/popmotion-plugin/script.ts Zobrazit soubor

import {_testFinish, BoxGeometry, Color, Mesh, PhysicalMaterial, PopmotionPlugin, ThreeViewer, Vector3} from 'threepipe'
import {
_testFinish,
BoxGeometry,
Color,
LoadingScreenPlugin,
Mesh,
PhysicalMaterial,
PopmotionPlugin,
ThreeViewer,
Vector3,
} from 'threepipe'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })
const popmotion = viewer.addPluginSync(PopmotionPlugin) const popmotion = viewer.addPluginSync(PopmotionPlugin)



+ 2
- 1
examples/progressive-hdr-shadows-exp/script.ts Zobrazit soubor

DataUtils, DataUtils,
DirectionalLight, DirectionalLight,
IObject3D, IObject3D,
LoadingScreenPlugin,
MaterialExtension, MaterialExtension,
ProgressivePlugin, ProgressivePlugin,
ShaderChunk, ShaderChunk,
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: false, msaa: false,
rgbm: false, rgbm: false,
plugins: [new ProgressivePlugin((window as any).TESTING ? 20 : 200), SSAAPlugin],
plugins: [new ProgressivePlugin((window as any).TESTING ? 20 : 200), SSAAPlugin, LoadingScreenPlugin],
dropzone: { dropzone: {
addOptions: { addOptions: {
disposeSceneObjects: true, disposeSceneObjects: true,

+ 2
- 0
examples/progressive-plugin/script.ts Zobrazit soubor

Box3B, Box3B,
DirectionalLight, DirectionalLight,
IObject3D, IObject3D,
LoadingScreenPlugin,
Mesh, Mesh,
PhysicalMaterial, PhysicalMaterial,
PlaneGeometry, PlaneGeometry,
importConfig: true, importConfig: true,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })
viewer.addPluginSync(new ProgressivePlugin((window as any).TESTING ? 20 : 200)) viewer.addPluginSync(new ProgressivePlugin((window as any).TESTING ? 20 : 200))
viewer.addPluginSync(new SSAAPlugin()) viewer.addPluginSync(new SSAAPlugin())

+ 6
- 3
examples/react-js-sample/index.html Zobrazit soubor

<body> <body>
<div id="root"></div> <div id="root"></div>
<script id="example-script" type="module" data-scripts="./index.html"> <script id="example-script" type="module" data-scripts="./index.html">
// import {ThreeViewer} from 'https://threepipe.org/dist/index.mjs'
import {ThreeViewer} from './../../dist/index.mjs'
// import {ThreeViewer, LoadingScreenPlugin} from 'https://threepipe.org/dist/index.mjs'
import {ThreeViewer, LoadingScreenPlugin} from './../../dist/index.mjs'
import React from 'https://esm.sh/react' import React from 'https://esm.sh/react'
import ReactDOM from 'https://esm.sh/react-dom' import ReactDOM from 'https://esm.sh/react-dom'


function ThreeViewerComponent({ src }) { function ThreeViewerComponent({ src }) {
const canvasRef = React.useRef(null); const canvasRef = React.useRef(null);
React.useEffect(() => { React.useEffect(() => {
const viewer = new ThreeViewer({canvas: canvasRef.current})
const viewer = new ThreeViewer({
canvas: canvasRef.current,
plugins: [LoadingScreenPlugin],
})


// Load an environment map // Load an environment map
const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr') const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')

+ 5
- 3
examples/react-jsx-sample/index.html Zobrazit soubor

<body> <body>
<div id="root"></div> <div id="root"></div>
<script id="example-script" type="text/babel" data-scripts="./index.html" data-type="module"> <script id="example-script" type="text/babel" data-scripts="./index.html" data-type="module">
// import {ThreeViewer} from 'https://threepipe.org/dist/index.mjs'
import {ThreeViewer} from './../../dist/index.mjs'
// import {ThreeViewer, LoadingScreenPlugin} from 'https://threepipe.org/dist/index.mjs'
import {ThreeViewer, LoadingScreenPlugin} from './../../dist/index.mjs'
import React from 'https://esm.sh/react' import React from 'https://esm.sh/react'
import ReactDOM from 'https://esm.sh/react-dom' import ReactDOM from 'https://esm.sh/react-dom'


function ThreeViewerComponent({ src, env }) { function ThreeViewerComponent({ src, env }) {
const canvasRef = React.useRef(null); const canvasRef = React.useRef(null);
React.useEffect(() => { React.useEffect(() => {
const viewer = new ThreeViewer({canvas: canvasRef.current})
const viewer = new ThreeViewer({canvas: canvasRef.current,
plugins: [LoadingScreenPlugin],
})


// Load an environment map // Load an environment map
const envPromise = viewer.setEnvironmentMap(env) const envPromise = viewer.setEnvironmentMap(env)

+ 4
- 2
examples/react-tsx-sample/script.tsx Zobrazit soubor

import {_testFinish, ThreeViewer} from 'threepipe'
import {_testFinish, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
// @ts-expect-error no need react here // @ts-expect-error no need react here
import React from 'react' import React from 'react'
// @ts-expect-error no need react-dom here // @ts-expect-error no need react-dom here
function ThreeViewerComponent({src, env}: {src: string, env: string}) { function ThreeViewerComponent({src, env}: {src: string, env: string}) {
const canvasRef = React.useRef(null) const canvasRef = React.useRef(null)
React.useEffect(() => { React.useEffect(() => {
const viewer = new ThreeViewer({canvas: canvasRef.current})
const viewer = new ThreeViewer({canvas: canvasRef.current,
plugins: [LoadingScreenPlugin],
})


// Load an environment map // Load an environment map
const envPromise = viewer.setEnvironmentMap(env) const envPromise = viewer.setEnvironmentMap(env)

+ 2
- 1
examples/rect-area-light/script.ts Zobrazit soubor

_testFinish, _testFinish,
Box3B, Box3B,
IObject3D, IObject3D,
LoadingScreenPlugin,
Mesh, Mesh,
Object3DWidgetsPlugin, Object3DWidgetsPlugin,
PhysicalMaterial, PhysicalMaterial,
autoSetEnvironment: true, // when hdr/exr is dropped autoSetEnvironment: true, // when hdr/exr is dropped
}, },
}, },
plugins: [Object3DWidgetsPlugin],
plugins: [Object3DWidgetsPlugin, LoadingScreenPlugin],
}) })


// viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10)) // viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10))

+ 2
- 0
examples/render-target-export/script.ts Zobrazit soubor

DepthBufferPlugin, DepthBufferPlugin,
downloadBlob, downloadBlob,
isWebpExportSupported, isWebpExportSupported,
LoadingScreenPlugin,
ThreeViewer, ThreeViewer,
UnsignedByteType, UnsignedByteType,
WebGLRenderTarget, WebGLRenderTarget,
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
rgbm: false, // this will make the composer target not use RGBM encoding, and use HalfFloat. Otherwise, its UnsignedByteType rgbm: false, // this will make the composer target not use RGBM encoding, and use HalfFloat. Otherwise, its UnsignedByteType
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 2
- 0
examples/render-target-preview/script.ts Zobrazit soubor

_testFinish, _testFinish,
DepthBufferPlugin, DepthBufferPlugin,
HalfFloatType, HalfFloatType,
LoadingScreenPlugin,
NormalBufferPlugin, NormalBufferPlugin,
RenderTargetPreviewPlugin, RenderTargetPreviewPlugin,
ThreeViewer, ThreeViewer,
msaa: true, msaa: true,
rgbm: true, rgbm: true,
zPrepass: false, zPrepass: false,
plugins: [LoadingScreenPlugin],
}) })


async function init() { async function init() {

+ 2
- 1
examples/rhino3dm-load/script.ts Zobrazit soubor

import {_testFinish, IObject3D, Rhino3dmLoadPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, Rhino3dmLoadPlugin, ThreeViewer} from 'threepipe'


async function init() { async function init() {


autoSetBackground: true, autoSetBackground: true,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(Rhino3dmLoadPlugin) viewer.addPluginSync(Rhino3dmLoadPlugin)

+ 2
- 1
examples/scene-uiconfig/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 2
- 1
examples/simplify-modifier-plugin/script.ts Zobrazit soubor

IGeometry, IGeometry,
IMaterial, IMaterial,
IObject3D, IObject3D,
LoadingScreenPlugin,
PickingPlugin, PickingPlugin,
SimplifyModifierPlugin, SimplifyModifierPlugin,
ThreeViewer, ThreeViewer,
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [PickingPlugin],
plugins: [PickingPlugin, LoadingScreenPlugin],
}) })


const simplify = viewer.addPluginSync(SimplifyModifierPluginImpl) const simplify = viewer.addPluginSync(SimplifyModifierPluginImpl)

+ 4
- 2
examples/splat-load/index.html Zobrazit soubor

</style> </style>
<script type="module" src="../examples-utils/simple-code-preview.mjs"></script> <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
<script id="example-script" type="module"> <script id="example-script" type="module">
import {_testFinish, ThreeViewer} from 'threepipe'
import {_testFinish, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {GaussianSplattingPlugin} from '@threepipe/plugin-gaussian-splatting' import {GaussianSplattingPlugin} from '@threepipe/plugin-gaussian-splatting'


const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas')})
const viewer = new ThreeViewer({canvas: document.getElementById('mcanvas'),
plugins: [LoadingScreenPlugin],
})
viewer.addPluginsSync([GaussianSplattingPlugin]) viewer.addPluginsSync([GaussianSplattingPlugin])


async function init() { async function init() {

+ 2
- 1
examples/spot-light/script.ts Zobrazit soubor

_testFinish, _testFinish,
Box3B, Box3B,
IObject3D, IObject3D,
LoadingScreenPlugin,
Mesh, Mesh,
Object3DWidgetsPlugin, Object3DWidgetsPlugin,
PCFSoftShadowMap, PCFSoftShadowMap,
autoSetEnvironment: true, // when hdr/exr is dropped autoSetEnvironment: true, // when hdr/exr is dropped
}, },
}, },
plugins: [Object3DWidgetsPlugin],
plugins: [Object3DWidgetsPlugin, LoadingScreenPlugin],
}) })


// viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10)) // viewer.scene.addObject(new HemisphereLight(0xffffff, 0x444444, 10))

+ 10
- 1
examples/ssaa-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, PhysicalMaterial, ProgressivePlugin, SSAAPlugin, ThreeViewer} from 'threepipe'
import {
_testFinish,
IObject3D,
LoadingScreenPlugin,
PhysicalMaterial,
ProgressivePlugin,
SSAAPlugin,
ThreeViewer,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
importConfig: true, importConfig: true,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })
viewer.addPluginSync(new SSAAPlugin()) viewer.addPluginSync(new SSAAPlugin())



+ 10
- 2
examples/ssao-plugin/script.ts Zobrazit soubor

import {_testFinish, RenderTargetPreviewPlugin, SSAAPlugin, SSAOPlugin, ThreeViewer, UnsignedByteType} from 'threepipe'
import {
_testFinish,
LoadingScreenPlugin,
RenderTargetPreviewPlugin,
SSAAPlugin,
SSAOPlugin,
ThreeViewer,
UnsignedByteType,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [SSAAPlugin],
plugins: [SSAAPlugin, LoadingScreenPlugin],
tonemap: false, tonemap: false,
}) })



+ 2
- 1
examples/stl-load/script.ts Zobrazit soubor

import {_testFinish, IObject3D, STLLoadPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, STLLoadPlugin, ThreeViewer} from 'threepipe'


async function init() { async function init() {


autoSetBackground: true, autoSetBackground: true,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(STLLoadPlugin) viewer.addPluginSync(STLLoadPlugin)

+ 5
- 3
examples/svelte-sample/App.svelte Zobrazit soubor

<script> <script>
import {onDestroy, onMount} from 'svelte'; import {onDestroy, onMount} from 'svelte';


const {ThreeViewer} = window.threepipe; // umd imported from unpkg in index.html
const {ThreeViewer, LoadingScreenPlugin} = window.threepipe; // umd imported from unpkg in index.html
// or // or
// import {ThreeViewer} from 'threepipe'; // esm imported from npm
// import {ThreeViewer, LoadingScreenPlugin} from 'threepipe'; // esm imported from npm


let canvasRef; let canvasRef;
let viewer; let viewer;


onMount(() => { onMount(() => {
viewer = new ThreeViewer({canvas: canvasRef});
viewer = new ThreeViewer({canvas: canvasRef,
plugins: [LoadingScreenPlugin],
});


// Load an environment map // Load an environment map
const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'); const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr');

+ 2
- 1
examples/svg-geometry-playground/script.ts Zobrazit soubor

_testFinish, _testFinish,
EditorViewWidgetPlugin, EditorViewWidgetPlugin,
GBufferPlugin, GBufferPlugin,
LoadingScreenPlugin,
PickingPlugin, PickingPlugin,
ThreeViewer, ThreeViewer,
TransformControlsPlugin, TransformControlsPlugin,
rgbm: false, rgbm: false,
// zPrepass: true, // zPrepass: true,
tonemap: false, tonemap: false,
plugins: [GBufferPlugin, PickingPlugin, TransformControlsPlugin],
plugins: [GBufferPlugin, PickingPlugin, TransformControlsPlugin, LoadingScreenPlugin],
}) })
viewer.addPluginSync(new EditorViewWidgetPlugin('bottom-left', 128)) viewer.addPluginSync(new EditorViewWidgetPlugin('bottom-left', 128))



+ 2
- 2
examples/three-first-person-controls-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeFirstPersonControlsPlugin, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeFirstPersonControlsPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [ThreeFirstPersonControlsPlugin],
plugins: [ThreeFirstPersonControlsPlugin, LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 14
- 3
examples/three-svg-renderer-plugin/script.ts Zobrazit soubor

import { import {
_testFinish, _testFinish,
DropzonePlugin,
EditorViewWidgetPlugin, EditorViewWidgetPlugin,
GBufferPlugin, GBufferPlugin,
GLTFAnimationPlugin, GLTFAnimationPlugin,
IObject3D, IObject3D,
LoadingScreenPlugin,
PickingPlugin, PickingPlugin,
ThreeViewer, ThreeViewer,
TransformControlsPlugin, TransformControlsPlugin,
rgbm: false, rgbm: false,
// zPrepass: true, // zPrepass: true,
tonemap: false, tonemap: false,
plugins: [GBufferPlugin, PickingPlugin, TransformControlsPlugin], /* TransformControlsPlugin */ // todo: transform controls doesnt work when selected object is in a parent.
plugins: [GBufferPlugin, PickingPlugin, TransformControlsPlugin, LoadingScreenPlugin], /* TransformControlsPlugin */ // todo: transform controls doesnt work when selected object is in a parent.
dropzone: {
autoAdd: true,
addOptions: {
disposeSceneObjects: true,
},
},
}) })
viewer.addPluginSync(new EditorViewWidgetPlugin('bottom-left', 128)) viewer.addPluginSync(new EditorViewWidgetPlugin('bottom-left', 128))


'https://threejs.org/examples/models/obj/male02/male02.obj', 'https://threejs.org/examples/models/obj/male02/male02.obj',
'https://threejs.org/examples/models/gltf/kira.glb', // slow 'https://threejs.org/examples/models/gltf/kira.glb', // slow


// to test
'https://cdn.jsdelivr.net/gh/KhronosGroup/glTF-Sample-Assets/Models/WaterBottle/glTF-Draco/WaterBottle.gltf',
'https://cdn.jsdelivr.net/gh/KhronosGroup/glTF-Sample-Assets/Models/MaterialsVariantsShoe/glTF/MaterialsVariantsShoe.gltf',

// not working/very slow // not working/very slow
'https://threejs.org/examples/models/gltf/Soldier.glb', 'https://threejs.org/examples/models/gltf/Soldier.glb',
'https://threejs.org/examples/models/gltf/LittlestTokyo.glb', 'https://threejs.org/examples/models/gltf/LittlestTokyo.glb',


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))
ui.setupPlugins(ThreeSVGRendererPlugin) ui.setupPlugins(ThreeSVGRendererPlugin)
ui.setupPlugins(GLTFAnimationPlugin)
ui.setupPlugins(PickingPlugin)
ui.setupPlugins(GLTFAnimationPlugin, PickingPlugin, DropzonePlugin)
} }


init().finally(_testFinish) init().finally(_testFinish)

+ 10
- 1
examples/tonemap-plugin/script.ts Zobrazit soubor

import {_testFinish, DepthBufferPlugin, IObject3D, ThreeViewer, TonemapPlugin, UnsignedByteType} from 'threepipe'
import {
_testFinish,
DepthBufferPlugin,
IObject3D,
LoadingScreenPlugin,
ThreeViewer,
TonemapPlugin,
UnsignedByteType,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
tonemap: true, // this is true by default tonemap: true, // this is true by default
plugins: [LoadingScreenPlugin],
}) })


// A GBuffer(depth buffer here) is required for the `tonemapBackground` flag in TonemapPlugin to work // A GBuffer(depth buffer here) is required for the `tonemapBackground` flag in TonemapPlugin to work

+ 9
- 2
examples/transform-animation-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, PopmotionPlugin, ThreeViewer, TransformAnimationPlugin} from 'threepipe'
import {
_testFinish,
IObject3D,
LoadingScreenPlugin,
PopmotionPlugin,
ThreeViewer,
TransformAnimationPlugin,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'
import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js' import {createSimpleButtons} from '../examples-utils/simple-bottom-buttons.js'




const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
plugins: [PopmotionPlugin],
plugins: [PopmotionPlugin, LoadingScreenPlugin],
}) })
const transformAnimPlugin = viewer.addPluginSync(TransformAnimationPlugin) const transformAnimPlugin = viewer.addPluginSync(TransformAnimationPlugin)
console.log(transformAnimPlugin) console.log(transformAnimPlugin)

+ 10
- 1
examples/transform-controls-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, PickingPlugin, ThreeViewer, TransformControlsPlugin} from 'threepipe'
import {
_testFinish,
IObject3D,
LoadingScreenPlugin,
PickingPlugin,
ThreeViewer,
TransformControlsPlugin,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })


viewer.scene.setBackgroundColor(0x151822) viewer.scene.setBackgroundColor(0x151822)

+ 2
- 1
examples/tweakpane-ui-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer, TonemapPlugin} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer, TonemapPlugin} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 11
- 1
examples/uint8-rgbm-hdr-test/script.ts Zobrazit soubor

import {_testFinish, BoxGeometry, Color, Mesh, PhysicalMaterial, ThreeViewer, TonemapPlugin} from 'threepipe'
import {
_testFinish,
BoxGeometry,
Color,
LoadingScreenPlugin,
Mesh,
PhysicalMaterial,
ThreeViewer,
TonemapPlugin,
} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
rgbm: true, rgbm: true,
plugins: [LoadingScreenPlugin],
}) })
viewer.scene.backgroundColor = new Color().set('black') viewer.scene.backgroundColor = new Color().set('black')
viewer.getPlugin(TonemapPlugin)!.exposure = 0.04 viewer.getPlugin(TonemapPlugin)!.exposure = 0.04

+ 2
- 1
examples/usdz-load/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer, USDZLoadPlugin} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer, USDZLoadPlugin} from 'threepipe'


async function init() { async function init() {


autoSetBackground: true, autoSetBackground: true,
}, },
}, },
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(USDZLoadPlugin) viewer.addPluginSync(USDZLoadPlugin)

+ 2
- 1
examples/viewer-uiconfig/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
msaa: true, msaa: true,
plugins: [LoadingScreenPlugin],
}) })


const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true)) const ui = viewer.addPluginSync(new TweakpaneUiPlugin(true))

+ 3
- 1
examples/vignette-plugin/script.ts Zobrazit soubor

import {_testFinish, IObject3D, ThreeViewer, VignettePlugin} from 'threepipe'
import {_testFinish, IObject3D, LoadingScreenPlugin, ThreeViewer, VignettePlugin} from 'threepipe'
import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane' import {TweakpaneUiPlugin} from '@threepipe/plugin-tweakpane'


async function init() { async function init() {


const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
renderScale: 'auto',
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(VignettePlugin) viewer.addPluginSync(VignettePlugin)

+ 2
- 1
examples/virtual-camera/script.ts Zobrazit soubor

_testFinish, _testFinish,
IObject3D, IObject3D,
LinearToneMapping, LinearToneMapping,
LoadingScreenPlugin,
Mesh, Mesh,
PerspectiveCamera2, PerspectiveCamera2,
PlaneGeometry, PlaneGeometry,
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
debug: true, debug: true,
plugins: [new ProgressivePlugin(16)],
plugins: [new ProgressivePlugin(16), LoadingScreenPlugin],
}) })
const virtualCameras = viewer.addPluginSync(VirtualCamerasPlugin) const virtualCameras = viewer.addPluginSync(VirtualCamerasPlugin)
const popmotion = viewer.addPluginSync(PopmotionPlugin) const popmotion = viewer.addPluginSync(PopmotionPlugin)

+ 2
- 1
examples/virtual-cameras-plugin/script.ts Zobrazit soubor

_testFinish, _testFinish,
HemisphereLight, HemisphereLight,
IObject3D, IObject3D,
LoadingScreenPlugin,
PerspectiveCamera2, PerspectiveCamera2,
ProgressivePlugin, ProgressivePlugin,
RenderTargetPreviewPlugin, RenderTargetPreviewPlugin,
const viewer = new ThreeViewer({ const viewer = new ThreeViewer({
canvas: document.getElementById('mcanvas') as HTMLCanvasElement, canvas: document.getElementById('mcanvas') as HTMLCanvasElement,
debug: true, debug: true,
plugins: [new ProgressivePlugin(16), SSAAPlugin],
plugins: [new ProgressivePlugin(16), SSAAPlugin, LoadingScreenPlugin],
}) })
const virtualCameras = viewer.addPluginSync(VirtualCamerasPlugin) const virtualCameras = viewer.addPluginSync(VirtualCamerasPlugin)



+ 6
- 3
examples/vue-html-sample/index.html Zobrazit soubor

<canvas id="three-canvas" style="width: 800px; height: 600px" ref="canvasRef"></canvas> <canvas id="three-canvas" style="width: 800px; height: 600px" ref="canvasRef"></canvas>
</div> </div>
<script id="example-script" type="module" data-scripts="./index.html"> <script id="example-script" type="module" data-scripts="./index.html">
// import { ThreeViewer } from 'https://threepipe.org/dist/index.mjs'
import { ThreeViewer } from './../../dist/index.mjs'
// import { ThreeViewer, LoadingScreenPlugin } from 'https://threepipe.org/dist/index.mjs'
import { ThreeViewer, LoadingScreenPlugin } from './../../dist/index.mjs'
import { createApp, ref, onMounted, onBeforeUnmount } from "https://unpkg.com/vue@3/dist/vue.esm-browser.prod.js"; import { createApp, ref, onMounted, onBeforeUnmount } from "https://unpkg.com/vue@3/dist/vue.esm-browser.prod.js";


const ThreeViewerComponent = { const ThreeViewerComponent = {
const canvasRef = ref(null); const canvasRef = ref(null);


onMounted(() => { onMounted(() => {
const viewer = new ThreeViewer({ canvas: canvasRef.value });
const viewer = new ThreeViewer({
canvas: canvasRef.value,
plugins: [LoadingScreenPlugin],
});


// Load an environment map // Load an environment map
const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'); const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr');

+ 5
- 2
examples/vue-sfc-sample/script.vue Zobrazit soubor

</template> </template>


<script> <script>
import {ThreeViewer} from "threepipe";
import {LoadingScreenPlugin, ThreeViewer} from "threepipe";
import {onBeforeUnmount, onMounted, ref} from "vue" import {onBeforeUnmount, onMounted, ref} from "vue"


export default { export default {
const canvasRef = ref(null); const canvasRef = ref(null);


onMounted(() => { onMounted(() => {
const viewer = new ThreeViewer({canvas: canvasRef.value});
const viewer = new ThreeViewer({
canvas: canvasRef.value,
plugins: [LoadingScreenPlugin],
});


// Load an environment map // Load an environment map
const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr'); const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr');

+ 2
- 1
examples/z-prepass/index.html Zobrazit soubor

</style> </style>
<script type="module" src="../examples-utils/simple-code-preview.mjs"></script> <script type="module" src="../examples-utils/simple-code-preview.mjs"></script>
<script id="example-script" type="module"> <script id="example-script" type="module">
import {_testFinish, DepthBufferPlugin, ThreeViewer, UnsignedByteType} from 'threepipe'
import {_testFinish, DepthBufferPlugin, LoadingScreenPlugin, ThreeViewer, UnsignedByteType} from 'threepipe'


async function init() { async function init() {


msaa: true, msaa: true,
rgbm: true, rgbm: true,
zPrepass: true, zPrepass: true,
plugins: [LoadingScreenPlugin],
}) })


viewer.addPluginSync(new DepthBufferPlugin(UnsignedByteType, true)) viewer.addPluginSync(new DepthBufferPlugin(UnsignedByteType, true))

Načítá se…
Zrušit
Uložit