1
0

RenderPass.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>RenderPass - 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">RenderPass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class represents a render pass. It takes a camera and a scene and produces
  17. a beauty pass for subsequent post processing effects.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const renderPass = new RenderPass( scene, camera );
  20. composer.addPass( renderPass );
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <h2 class="subsection-title">Import</h2>
  25. <p><span translate="no">RenderPass</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>
  26. <pre><code class="language-js">import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';</code></pre>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="RenderPass" translate="no">new <a href="#RenderPass">RenderPass</a><span class="signature">( scene : <span class="param-type"><a href="Scene.html">Scene</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span>, overrideMaterial : <span class="param-type"><a href="Material.html">Material</a></span>, clearColor : <span class="param-type">number | <a href="Color.html">Color</a> | string</span>, clearAlpha : <span class="param-type">number</span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new render pass.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name">
  38. <strong>scene</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The scene to render.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong>camera</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The camera.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong>overrideMaterial</strong>
  55. </td>
  56. <td class="description last">
  57. <p>The override material. If set, this material is used
  58. for all objects in the scene.</p>
  59. <p>Default is <code>null</code>.</p>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class="name">
  64. <strong>clearColor</strong>
  65. </td>
  66. <td class="description last">
  67. <p>The clear color of the render pass.</p>
  68. <p>Default is <code>null</code>.</p>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td class="name">
  73. <strong>clearAlpha</strong>
  74. </td>
  75. <td class="description last">
  76. <p>The clear alpha of the render pass.</p>
  77. <p>Default is <code>null</code>.</p>
  78. </td>
  79. </tr>
  80. </tbody>
  81. </table>
  82. </div>
  83. </div>
  84. <h2 class="subsection-title">Properties</h2>
  85. <div class="member">
  86. <h3 class="name" id="camera" translate="no">.<a href="#camera">camera</a><span class="type-signature"> : <a href="Camera.html">Camera</a></span> </h3>
  87. <div class="description">
  88. <p>The camera.</p>
  89. </div>
  90. </div>
  91. <div class="member">
  92. <h3 class="name" id="clear" translate="no">.<a href="#clear">clear</a><span class="type-signature"> : boolean</span> </h3>
  93. <div class="description">
  94. <p>Overwritten to perform a clear operation by default.</p>
  95. <p>Default is <code>true</code>.</p>
  96. </div>
  97. <dl class="details">
  98. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#clear">Pass#clear</a></dt>
  99. </dl>
  100. </div>
  101. <div class="member">
  102. <h3 class="name" id="clearAlpha" translate="no">.<a href="#clearAlpha">clearAlpha</a><span class="type-signature"> : number</span> </h3>
  103. <div class="description">
  104. <p>The clear alpha of the render pass.</p>
  105. <p>Default is <code>null</code>.</p>
  106. </div>
  107. </div>
  108. <div class="member">
  109. <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>
  110. <div class="description">
  111. <p>The clear color of the render pass.</p>
  112. <p>Default is <code>null</code>.</p>
  113. </div>
  114. </div>
  115. <div class="member">
  116. <h3 class="name" id="clearDepth" translate="no">.<a href="#clearDepth">clearDepth</a><span class="type-signature"> : boolean</span> </h3>
  117. <div class="description">
  118. <p>If set to <code>true</code>, only the depth can be cleared when <code>clear</code> is to <code>false</code>.</p>
  119. <p>Default is <code>false</code>.</p>
  120. </div>
  121. </div>
  122. <div class="member">
  123. <h3 class="name" id="needsSwap" translate="no">.<a href="#needsSwap">needsSwap</a><span class="type-signature"> : boolean</span> </h3>
  124. <div class="description">
  125. <p>Overwritten to disable the swap.</p>
  126. <p>Default is <code>false</code>.</p>
  127. </div>
  128. <dl class="details">
  129. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#needsSwap">Pass#needsSwap</a></dt>
  130. </dl>
  131. </div>
  132. <div class="member">
  133. <h3 class="name" id="overrideMaterial" translate="no">.<a href="#overrideMaterial">overrideMaterial</a><span class="type-signature"> : <a href="Material.html">Material</a></span> </h3>
  134. <div class="description">
  135. <p>The override material. If set, this material is used
  136. for all objects in the scene.</p>
  137. <p>Default is <code>null</code>.</p>
  138. </div>
  139. </div>
  140. <div class="member">
  141. <h3 class="name" id="scene" translate="no">.<a href="#scene">scene</a><span class="type-signature"> : <a href="Scene.html">Scene</a></span> </h3>
  142. <div class="description">
  143. <p>The scene to render.</p>
  144. </div>
  145. </div>
  146. <h2 class="subsection-title">Methods</h2>
  147. <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>
  148. <div class="method">
  149. <div class="description">
  150. <p>Performs a beauty pass with the configured scene and camera.</p>
  151. </div>
  152. <table class="params">
  153. <tbody>
  154. <tr>
  155. <td class="name">
  156. <strong>renderer</strong>
  157. </td>
  158. <td class="description last">
  159. <p>The renderer.</p>
  160. </td>
  161. </tr>
  162. <tr>
  163. <td class="name">
  164. <strong>writeBuffer</strong>
  165. </td>
  166. <td class="description last">
  167. <p>The write buffer. This buffer is intended as the rendering
  168. destination for the pass.</p>
  169. </td>
  170. </tr>
  171. <tr>
  172. <td class="name">
  173. <strong>readBuffer</strong>
  174. </td>
  175. <td class="description last">
  176. <p>The read buffer. The pass can access the result from the
  177. previous pass from this buffer.</p>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td class="name">
  182. <strong>deltaTime</strong>
  183. </td>
  184. <td class="description last">
  185. <p>The delta time in seconds.</p>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td class="name">
  190. <strong>maskActive</strong>
  191. </td>
  192. <td class="description last">
  193. <p>Whether masking is active or not.</p>
  194. </td>
  195. </tr>
  196. </tbody>
  197. </table>
  198. <dl class="details">
  199. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  200. </dl>
  201. </div>
  202. <h2 class="subsection-title">Source</h2>
  203. <p>
  204. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/RenderPass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/RenderPass.js</a>
  205. </p>
  206. </article>
  207. </section>
  208. <script src="../scripts/linenumber.js"></script>
  209. <script src="../scripts/page.js"></script>
  210. </body>
  211. </html>
粤ICP备19079148号