BloomPass.html 8.1 KB

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