threepipe
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.html 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Z-Prepass test</title>
  6. <!-- Import map -->
  7. <script type="importmap">
  8. {
  9. "imports": {
  10. "threepipe": "./../../dist/index.mjs"
  11. }
  12. }
  13. </script>
  14. <style id="example-style">
  15. html, body, #canvas-container, #mcanvas {
  16. width: 100%;
  17. height: 100%;
  18. margin: 0;
  19. overflow: hidden;
  20. }
  21. </style>
  22. <script type="module" src="../js-utils/simple-code-preview.mjs"> </script>
  23. <script id="example-script" type="module">
  24. import {_testFinish, DepthBufferPlugin, UnsignedByteType, ThreeViewer} from 'threepipe'
  25. async function init() {
  26. const viewer = new ThreeViewer({
  27. canvas: document.getElementById('mcanvas'),
  28. msaa: true,
  29. rgbm: true,
  30. zPrepass: true,
  31. })
  32. viewer.addPluginSync(new DepthBufferPlugin(UnsignedByteType, true))
  33. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  34. await viewer.load('https://threejs.org/examples/models/gltf/kira.glb', {
  35. autoCenter: true,
  36. autoScale: true,
  37. })
  38. }
  39. init().then(_testFinish)
  40. </script>
  41. </head>
  42. <body>
  43. <div id="canvas-container">
  44. <canvas id="mcanvas"></canvas>
  45. </div>
  46. </body>