GlitchPass.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>GlitchPass - 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. <p class="inheritance" translate="no"><a href="Pass.html">Pass</a> → </p>
  13. <h1 translate="no">GlitchPass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Pass for creating a glitch effect.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const glitchPass = new GlitchPass();
  19. composer.addPass( glitchPass );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">GlitchPass</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>
  25. <pre><code class="language-js">import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="GlitchPass" translate="no">new <a href="#GlitchPass">GlitchPass</a><span class="signature">( dt_size : <span class="param-type">number</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new glitch pass.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>dt_size</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The size of the displacement texture
  41. for digital glitch squares.</p>
  42. <p>Default is <code>64</code>.</p>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. <h2 class="subsection-title">Properties</h2>
  50. <div class="member">
  51. <h3 class="name" id="goWild" translate="no">.<a href="#goWild">goWild</a><span class="type-signature"> : boolean</span> </h3>
  52. <div class="description">
  53. <p>Whether to noticeably increase the effect intensity or not.</p>
  54. <p>Default is <code>false</code>.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="material" translate="no">.<a href="#material">material</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  59. <div class="description">
  60. <p>The pass material.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="uniforms" translate="no">.<a href="#uniforms">uniforms</a><span class="type-signature"> : Object</span> </h3>
  65. <div class="description">
  66. <p>The pass uniforms.</p>
  67. </div>
  68. </div>
  69. <h2 class="subsection-title">Methods</h2>
  70. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  71. <div class="method">
  72. <div class="description">
  73. <p>Frees the GPU-related resources allocated by this instance. Call this
  74. method whenever the pass is no longer used in your app.</p>
  75. </div>
  76. <dl class="details">
  77. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  78. </dl>
  79. </div>
  80. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( renderer : <span class="param-type"><a href="WebGLRenderer.html">WebGLRenderer</a></span>, writeBuffer : <span class="param-type"><a href="WebGLRenderTarget.html">WebGLRenderTarget</a></span>, readBuffer : <span class="param-type"><a href="WebGLRenderTarget.html">WebGLRenderTarget</a></span>, deltaTime : <span class="param-type">number</span>, maskActive : <span class="param-type">boolean</span> )</span> </h3>
  81. <div class="method">
  82. <div class="description">
  83. <p>Performs the glitch pass.</p>
  84. </div>
  85. <table class="params">
  86. <tbody>
  87. <tr>
  88. <td class="name">
  89. <strong>renderer</strong>
  90. </td>
  91. <td class="description last">
  92. <p>The renderer.</p>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td class="name">
  97. <strong>writeBuffer</strong>
  98. </td>
  99. <td class="description last">
  100. <p>The write buffer. This buffer is intended as the rendering
  101. destination for the pass.</p>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td class="name">
  106. <strong>readBuffer</strong>
  107. </td>
  108. <td class="description last">
  109. <p>The read buffer. The pass can access the result from the
  110. previous pass from this buffer.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong>deltaTime</strong>
  116. </td>
  117. <td class="description last">
  118. <p>The delta time in seconds.</p>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td class="name">
  123. <strong>maskActive</strong>
  124. </td>
  125. <td class="description last">
  126. <p>Whether masking is active or not.</p>
  127. </td>
  128. </tr>
  129. </tbody>
  130. </table>
  131. <dl class="details">
  132. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  133. </dl>
  134. </div>
  135. <h2 class="subsection-title">Source</h2>
  136. <p>
  137. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/GlitchPass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/GlitchPass.js</a>
  138. </p>
  139. </article>
  140. </section>
  141. <script src="../scripts/linenumber.js"></script>
  142. <script src="../scripts/page.js"></script>
  143. </body>
  144. </html>
粤ICP备19079148号