threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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, LoadingScreenPlugin, 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. plugins: [LoadingScreenPlugin],
  35. })
  36. viewer.addPluginSync(new DepthBufferPlugin(UnsignedByteType, true))
  37. await viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr')
  38. await viewer.load('https://threejs.org/examples/models/gltf/kira.glb', {
  39. autoCenter: true,
  40. autoScale: true,
  41. })
  42. }
  43. init().finally(_testFinish)
  44. </script>
  45. </head>
  46. <body>
  47. <div id="canvas-container">
  48. <canvas id="mcanvas"></canvas>
  49. </div>
  50. </body>