Pass.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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">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<br/>Default is <code>false</code>.</p>
  36. </div>
  37. </div>
  38. <div class="member">
  39. <h3 class="name" id="enabled" translate="no">.<a href="#enabled">enabled</a><span class="type-signature"> : boolean</span> </h3>
  40. <div class="description">
  41. <p>If set to <code>true</code>, the pass is processed by the composer.<br/>Default is <code>true</code>.</p>
  42. </div>
  43. </div>
  44. <div class="member">
  45. <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>
  46. <div class="description">
  47. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  48. </div>
  49. </div>
  50. <div class="member">
  51. <h3 class="name" id="needsSwap" translate="no">.<a href="#needsSwap">needsSwap</a><span class="type-signature"> : boolean</span> </h3>
  52. <div class="description">
  53. <p>If set to <code>true</code>, the pass indicates to swap read and write buffer after rendering.<br/>Default is <code>true</code>.</p>
  54. </div>
  55. </div>
  56. <div class="member">
  57. <h3 class="name" id="renderToScreen" translate="no">.<a href="#renderToScreen">renderToScreen</a><span class="type-signature"> : boolean</span> </h3>
  58. <div class="description">
  59. <p>If set to <code>true</code>, the result of the pass is rendered to screen. The last pass in the composers
  60. pass chain gets automatically rendered to screen, no matter how this property is configured.<br/>Default is <code>false</code>.</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> <span class="type-signature">(abstract) </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. </div>
  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> <span class="type-signature">(abstract) </span></h3>
  72. <div class="method">
  73. <div class="description">
  74. <p>This method holds the render logic of a pass. It must be implemented in all derived classes.</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. </div>
  103. <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>
  104. <div class="method">
  105. <div class="description">
  106. <p>Sets the size of the pass.</p>
  107. </div>
  108. <table class="params">
  109. <tbody>
  110. <tr>
  111. <td class="name"><code>width</code></td>
  112. <td class="description last"><p>The width to set.</p></td>
  113. </tr>
  114. <tr>
  115. <td class="name"><code>height</code></td>
  116. <td class="description last"><p>The height to set.</p></td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. </div>
  121. <h2 class="subsection-title">Source</h2>
  122. <p>
  123. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/Pass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/Pass.js</a>
  124. </p>
  125. </article>
  126. </section>
  127. <script src="../scripts/linenumber.js"></script>
  128. <script src="../scripts/page.js"></script>
  129. </body>
  130. </html>
粤ICP备19079148号