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.

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