ParallaxBarrierEffect.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ParallaxBarrierEffect - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">ParallaxBarrierEffect</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A class that creates an parallax barrier effect.</p>
  16. <p>Note that this class can only be used with <a href="WebGLRenderer.html">WebGLRenderer</a>.
  17. When using <a href="WebGPURenderer.html">WebGPURenderer</a>, use <a href="ParallaxBarrierPassNode.html">ParallaxBarrierPassNode</a>.</p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <p><span translate="no">ParallaxBarrierEffect</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  22. <pre><code class="language-js">import { ParallaxBarrierEffect } from 'three/addons/effects/ParallaxBarrierEffect.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="ParallaxBarrierEffect" translate="no">new <a href="#ParallaxBarrierEffect">ParallaxBarrierEffect</a><span class="signature">( renderer : <span class="param-type"><a href="WebGLRenderer.html">WebGLRenderer</a></span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new parallax barrier effect.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>renderer</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The renderer.</p>
  38. </td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Methods</h2>
  45. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  46. <div class="method">
  47. <div class="description">
  48. <p>Frees internal resources. This method should be called
  49. when the effect is no longer required.</p>
  50. </div>
  51. </div>
  52. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( scene : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span> )</span> </h3>
  53. <div class="method">
  54. <div class="description">
  55. <p>When using this effect, this method should be called instead of the
  56. default <a href="WebGLRenderer.html#render">WebGLRenderer#render</a>.</p>
  57. </div>
  58. <table class="params">
  59. <tbody>
  60. <tr>
  61. <td class="name">
  62. <strong>scene</strong>
  63. </td>
  64. <td class="description last">
  65. <p>The scene to render.</p>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td class="name">
  70. <strong>camera</strong>
  71. </td>
  72. <td class="description last">
  73. <p>The camera.</p>
  74. </td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. </div>
  79. <h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  80. <div class="method">
  81. <div class="description">
  82. <p>Resizes the effect.</p>
  83. </div>
  84. <table class="params">
  85. <tbody>
  86. <tr>
  87. <td class="name">
  88. <strong>width</strong>
  89. </td>
  90. <td class="description last">
  91. <p>The width of the effect in logical pixels.</p>
  92. </td>
  93. </tr>
  94. <tr>
  95. <td class="name">
  96. <strong>height</strong>
  97. </td>
  98. <td class="description last">
  99. <p>The height of the effect in logical pixels.</p>
  100. </td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. </div>
  105. <h2 class="subsection-title">Source</h2>
  106. <p>
  107. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/effects/ParallaxBarrierEffect.js" translate="no" target="_blank" rel="noopener">examples/jsm/effects/ParallaxBarrierEffect.js</a>
  108. </p>
  109. </article>
  110. </section>
  111. <script src="../scripts/linenumber.js"></script>
  112. <script src="../scripts/page.js"></script>
  113. </body>
  114. </html>
粤ICP备19079148号