GlitchPass.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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">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"><code>dt_size</code></td>
  37. <td class="description last"><p>The size of the displacement texture
  38. for digital glitch squares.<br/>Default is <code>64</code>.</p></td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Properties</h2>
  45. <div class="member">
  46. <h3 class="name" id="goWild" translate="no">.<a href="#goWild">goWild</a><span class="type-signature"> : boolean</span> </h3>
  47. <div class="description">
  48. <p>Whether to noticeably increase the effect intensity or not.<br/>Default is <code>false</code>.</p>
  49. </div>
  50. </div>
  51. <div class="member">
  52. <h3 class="name" id="material" translate="no">.<a href="#material">material</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  53. <div class="description">
  54. <p>The pass material.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="uniforms" translate="no">.<a href="#uniforms">uniforms</a><span class="type-signature"> : Object</span> </h3>
  59. <div class="description">
  60. <p>The pass uniforms.</p>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Methods</h2>
  64. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  65. <div class="method">
  66. <div class="description">
  67. <p>Frees the GPU-related resources allocated by this instance. Call this
  68. method whenever the pass is no longer used in your app.</p>
  69. </div>
  70. <dl class="details">
  71. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  72. </dl>
  73. </div>
  74. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( renderer : <span class="param-type">WebGLRenderer</span>, writeBuffer : <span class="param-type">WebGLRenderTarget</span>, readBuffer : <span class="param-type">WebGLRenderTarget</span>, deltaTime : <span class="param-type">number</span>, maskActive : <span class="param-type">boolean</span> )</span> </h3>
  75. <div class="method">
  76. <div class="description">
  77. <p>Performs the glitch pass.</p>
  78. </div>
  79. <table class="params">
  80. <tbody>
  81. <tr>
  82. <td class="name"><code>renderer</code></td>
  83. <td class="description last"><p>The renderer.</p></td>
  84. </tr>
  85. <tr>
  86. <td class="name"><code>writeBuffer</code></td>
  87. <td class="description last"><p>The write buffer. This buffer is intended as the rendering
  88. destination for the pass.</p></td>
  89. </tr>
  90. <tr>
  91. <td class="name"><code>readBuffer</code></td>
  92. <td class="description last"><p>The read buffer. The pass can access the result from the
  93. previous pass from this buffer.</p></td>
  94. </tr>
  95. <tr>
  96. <td class="name"><code>deltaTime</code></td>
  97. <td class="description last"><p>The delta time in seconds.</p></td>
  98. </tr>
  99. <tr>
  100. <td class="name"><code>maskActive</code></td>
  101. <td class="description last"><p>Whether masking is active or not.</p></td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. <dl class="details">
  106. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  107. </dl>
  108. </div>
  109. <h2 class="subsection-title">Source</h2>
  110. <p>
  111. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/GlitchPass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/GlitchPass.js</a>
  112. </p>
  113. </article>
  114. </section>
  115. <script src="../scripts/linenumber.js"></script>
  116. <script src="../scripts/page.js"></script>
  117. </body>
  118. </html>
粤ICP备19079148号