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.

index.html 1.6KB

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