Pass.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Pass - 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. <h1 translate="no">Pass</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Abstract base class for all post processing passes.</p>
  16. <p>This module is only relevant for post processing with <a href="WebGLRenderer.html">WebGLRenderer</a>.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">Pass</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>
  21. <pre><code class="language-js">import { Pass } from 'three/addons/postprocessing/Pass.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="Pass" translate="no">new <a href="#Pass">Pass</a><span class="signature">()</span> <span class="type-signature">(abstract) </span></h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new pass.</p>
  28. </div>
  29. </div>
  30. </div>
  31. <h2 class="subsection-title">Properties</h2>
  32. <div class="member">
  33. <h3 class="name" id="clear" translate="no">.<a href="#clear">clear</a><span class="type-signature"> : boolean</span> </h3>
  34. <div class="description">
  35. <p>If set to <code>true</code>, the pass clears its buffer before rendering</p>
  36. <p>Default is <code>false</code>.</p>
  37. </div>
  38. </div>
  39. <div class="member">
  40. <h3 class="name" id="enabled" translate="no">.<a href="#enabled">enabled</a><span class="type-signature"> : boolean</span> </h3>
  41. <div class="description">
  42. <p>If set to <code>true</code>, the pass is processed by the composer.</p>
  43. <p>Default is <code>true</code>.</p>
  44. </div>
  45. </div>
  46. <div class="member">
  47. <h3 class="name" id="isPass" translate="no">.<a href="#isPass">isPass</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  48. <div class="description">
  49. <p>This flag can be used for type testing.</p>
  50. <p>Default is <code>true</code>.</p>
  51. </div>
  52. </div>
  53. <div class="member">
  54. <h3 class="name" id="needsSwap" translate="no">.<a href="#needsSwap">needsSwap</a><span class="type-signature"> : boolean</span> </h3>
  55. <div class="description">
  56. <p>If set to <code>true</code>, the pass indicates to swap read and write buffer after rendering.</p>
  57. <p>Default is <code>true</code>.</p>
  58. </div>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="renderToScreen" translate="no">.<a href="#renderToScreen">renderToScreen</a><span class="type-signature"> : boolean</span> </h3>
  62. <div class="description">
  63. <p>If set to <code>true</code>, the result of the pass is rendered to screen. The last pass in the composers
  64. pass chain gets automatically rendered to screen, no matter how this property is configured.</p>
  65. <p>Default is <code>false</code>.</p>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Methods</h2>
  69. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> <span class="type-signature">(abstract) </span></h3>
  70. <div class="method">
  71. <div class="description">
  72. <p>Frees the GPU-related resources allocated by this instance. Call this
  73. method whenever the pass is no longer used in your app.</p>
  74. </div>
  75. </div>
  76. <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> <span class="type-signature">(abstract) </span></h3>
  77. <div class="method">
  78. <div class="description">
  79. <p>This method holds the render logic of a pass. It must be implemented in all derived classes.</p>
  80. </div>
  81. <table class="params">
  82. <tbody>
  83. <tr>
  84. <td class="name">
  85. <strong>renderer</strong>
  86. </td>
  87. <td class="description last">
  88. <p>The renderer.</p>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class="name">
  93. <strong>writeBuffer</strong>
  94. </td>
  95. <td class="description last">
  96. <p>The write buffer. This buffer is intended as the rendering
  97. destination for the pass.</p>
  98. </td>
  99. </tr>
  100. <tr>
  101. <td class="name">
  102. <strong>readBuffer</strong>
  103. </td>
  104. <td class="description last">
  105. <p>The read buffer. The pass can access the result from the
  106. previous pass from this buffer.</p>
  107. </td>
  108. </tr>
  109. <tr>
  110. <td class="name">
  111. <strong>deltaTime</strong>
  112. </td>
  113. <td class="description last">
  114. <p>The delta time in seconds.</p>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="name">
  119. <strong>maskActive</strong>
  120. </td>
  121. <td class="description last">
  122. <p>Whether masking is active or not.</p>
  123. </td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. </div>
  128. <h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> <span class="type-signature">(abstract) </span></h3>
  129. <div class="method">
  130. <div class="description">
  131. <p>Sets the size of the pass.</p>
  132. </div>
  133. <table class="params">
  134. <tbody>
  135. <tr>
  136. <td class="name">
  137. <strong>width</strong>
  138. </td>
  139. <td class="description last">
  140. <p>The width to set.</p>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td class="name">
  145. <strong>height</strong>
  146. </td>
  147. <td class="description last">
  148. <p>The height to set.</p>
  149. </td>
  150. </tr>
  151. </tbody>
  152. </table>
  153. </div>
  154. <h2 class="subsection-title">Source</h2>
  155. <p>
  156. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/Pass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/Pass.js</a>
  157. </p>
  158. </article>
  159. </section>
  160. <script src="../scripts/linenumber.js"></script>
  161. <script src="../scripts/page.js"></script>
  162. </body>
  163. </html>
粤ICP备19079148号