DotScreenPass.html 6.2 KB

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