ClearPass.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ClearPass - 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">ClearPass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class can be used to force a clear operation for the current read or
  17. default framebuffer (when rendering to screen).</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const clearPass = new ClearPass();
  20. composer.addPass( clearPass );
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <h2 class="subsection-title">Import</h2>
  25. <p><span translate="no">ClearPass</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  26. <pre><code class="language-js">import { ClearPass } from 'three/addons/postprocessing/ClearPass.js';</code></pre>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="ClearPass" translate="no">new <a href="#ClearPass">ClearPass</a><span class="signature">( clearColor : <span class="param-type">number | Color | string</span>, clearAlpha : <span class="param-type">number</span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new clear pass.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name"><code>clearColor</code></td>
  38. <td class="description last"><p>The clear color.<br/>Default is <code>0x000000</code>.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>clearAlpha</code></td>
  42. <td class="description last"><p>The clear alpha.<br/>Default is <code>0</code>.</p></td>
  43. </tr>
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. <h2 class="subsection-title">Properties</h2>
  49. <div class="member">
  50. <h3 class="name" id="clearAlpha" translate="no">.<a href="#clearAlpha">clearAlpha</a><span class="type-signature"> : number</span> </h3>
  51. <div class="description">
  52. <p>The clear alpha.<br/>Default is <code>0</code>.</p>
  53. </div>
  54. </div>
  55. <div class="member">
  56. <h3 class="name" id="clearColor" translate="no">.<a href="#clearColor">clearColor</a><span class="type-signature"> : number | <a href="Color.html">Color</a> | string</span> </h3>
  57. <div class="description">
  58. <p>The clear color.<br/>Default is <code>0x000000</code>.</p>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="needsSwap" translate="no">.<a href="#needsSwap">needsSwap</a><span class="type-signature"> : boolean</span> </h3>
  63. <div class="description">
  64. <p>Overwritten to disable the swap.<br/>Default is <code>false</code>.</p>
  65. </div>
  66. <dl class="details">
  67. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#needsSwap">Pass#needsSwap</a></dt>
  68. </dl>
  69. </div>
  70. <h2 class="subsection-title">Methods</h2>
  71. <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>
  72. <div class="method">
  73. <div class="description">
  74. <p>Performs the clear operation. This affects the current read or the default framebuffer.</p>
  75. </div>
  76. <table class="params">
  77. <tbody>
  78. <tr>
  79. <td class="name"><code>renderer</code></td>
  80. <td class="description last"><p>The renderer.</p></td>
  81. </tr>
  82. <tr>
  83. <td class="name"><code>writeBuffer</code></td>
  84. <td class="description last"><p>The write buffer. This buffer is intended as the rendering
  85. destination for the pass.</p></td>
  86. </tr>
  87. <tr>
  88. <td class="name"><code>readBuffer</code></td>
  89. <td class="description last"><p>The read buffer. The pass can access the result from the
  90. previous pass from this buffer.</p></td>
  91. </tr>
  92. <tr>
  93. <td class="name"><code>deltaTime</code></td>
  94. <td class="description last"><p>The delta time in seconds.</p></td>
  95. </tr>
  96. <tr>
  97. <td class="name"><code>maskActive</code></td>
  98. <td class="description last"><p>Whether masking is active or not.</p></td>
  99. </tr>
  100. </tbody>
  101. </table>
  102. <dl class="details">
  103. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  104. </dl>
  105. </div>
  106. <h2 class="subsection-title">Source</h2>
  107. <p>
  108. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/ClearPass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/ClearPass.js</a>
  109. </p>
  110. </article>
  111. </section>
  112. <script src="../scripts/linenumber.js"></script>
  113. <script src="../scripts/page.js"></script>
  114. </body>
  115. </html>
粤ICP备19079148号