DotScreenPass.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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">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">Vector2</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"><code>center</code></td>
  37. <td class="description last"><p>The center point.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>angle</code></td>
  41. <td class="description last"><p>The rotation of the effect in radians.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>scale</code></td>
  45. <td class="description last"><p>The scale of the effect. A higher value means smaller dots.</p></td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. <h2 class="subsection-title">Properties</h2>
  52. <div class="member">
  53. <h3 class="name" id="material" translate="no">.<a href="#material">material</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  54. <div class="description">
  55. <p>The pass material.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <h3 class="name" id="uniforms" translate="no">.<a href="#uniforms">uniforms</a><span class="type-signature"> : Object</span> </h3>
  60. <div class="description">
  61. <p>The pass uniforms. Use this object if you want to update the
  62. <code>center</code>, <code>angle</code> or <code>scale</code> values at runtime.</p>
  63. <pre><code class="language-js">pass.uniforms.center.value.copy( center );
  64. pass.uniforms.angle.value = 0;
  65. pass.uniforms.scale.value = 0.5;
  66. </code></pre>
  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">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>
  81. <div class="method">
  82. <div class="description">
  83. <p>Performs the dot screen pass.</p>
  84. </div>
  85. <table class="params">
  86. <tbody>
  87. <tr>
  88. <td class="name"><code>renderer</code></td>
  89. <td class="description last"><p>The renderer.</p></td>
  90. </tr>
  91. <tr>
  92. <td class="name"><code>writeBuffer</code></td>
  93. <td class="description last"><p>The write buffer. This buffer is intended as the rendering
  94. destination for the pass.</p></td>
  95. </tr>
  96. <tr>
  97. <td class="name"><code>readBuffer</code></td>
  98. <td class="description last"><p>The read buffer. The pass can access the result from the
  99. previous pass from this buffer.</p></td>
  100. </tr>
  101. <tr>
  102. <td class="name"><code>deltaTime</code></td>
  103. <td class="description last"><p>The delta time in seconds.</p></td>
  104. </tr>
  105. <tr>
  106. <td class="name"><code>maskActive</code></td>
  107. <td class="description last"><p>Whether masking is active or not.</p></td>
  108. </tr>
  109. </tbody>
  110. </table>
  111. <dl class="details">
  112. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  113. </dl>
  114. </div>
  115. <h2 class="subsection-title">Source</h2>
  116. <p>
  117. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/DotScreenPass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/DotScreenPass.js</a>
  118. </p>
  119. </article>
  120. </section>
  121. <script src="../scripts/linenumber.js"></script>
  122. <script src="../scripts/page.js"></script>
  123. </body>
  124. </html>
粤ICP备19079148号