BloomPass.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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">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"><code>strength</code></td>
  39. <td class="description last"><p>The Bloom strength.<br/>Default is <code>1</code>.</p></td>
  40. </tr>
  41. <tr>
  42. <td class="name"><code>kernelSize</code></td>
  43. <td class="description last"><p>The kernel size.<br/>Default is <code>25</code>.</p></td>
  44. </tr>
  45. <tr>
  46. <td class="name"><code>sigma</code></td>
  47. <td class="description last"><p>The sigma.<br/>Default is <code>4</code>.</p></td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53. <h2 class="subsection-title">Properties</h2>
  54. <div class="member">
  55. <h3 class="name" id="combineUniforms" translate="no">.<a href="#combineUniforms">combineUniforms</a><span class="type-signature"> : Object</span> </h3>
  56. <div class="description">
  57. <p>The combine pass uniforms.</p>
  58. </div>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="convolutionUniforms" translate="no">.<a href="#convolutionUniforms">convolutionUniforms</a><span class="type-signature"> : Object</span> </h3>
  62. <div class="description">
  63. <p>The convolution pass uniforms.</p>
  64. </div>
  65. </div>
  66. <div class="member">
  67. <h3 class="name" id="materialCombine" translate="no">.<a href="#materialCombine">materialCombine</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  68. <div class="description">
  69. <p>The combine pass material.</p>
  70. </div>
  71. </div>
  72. <div class="member">
  73. <h3 class="name" id="materialConvolution" translate="no">.<a href="#materialConvolution">materialConvolution</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  74. <div class="description">
  75. <p>The convolution pass material.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="needsSwap" translate="no">.<a href="#needsSwap">needsSwap</a><span class="type-signature"> : boolean</span> </h3>
  80. <div class="description">
  81. <p>Overwritten to disable the swap.<br/>Default is <code>false</code>.</p>
  82. </div>
  83. <dl class="details">
  84. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#needsSwap">Pass#needsSwap</a></dt>
  85. </dl>
  86. </div>
  87. <h2 class="subsection-title">Methods</h2>
  88. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  89. <div class="method">
  90. <div class="description">
  91. <p>Frees the GPU-related resources allocated by this instance. Call this
  92. method whenever the pass is no longer used in your app.</p>
  93. </div>
  94. <dl class="details">
  95. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  96. </dl>
  97. </div>
  98. <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>
  99. <div class="method">
  100. <div class="description">
  101. <p>Performs the Bloom pass.</p>
  102. </div>
  103. <table class="params">
  104. <tbody>
  105. <tr>
  106. <td class="name"><code>renderer</code></td>
  107. <td class="description last"><p>The renderer.</p></td>
  108. </tr>
  109. <tr>
  110. <td class="name"><code>writeBuffer</code></td>
  111. <td class="description last"><p>The write buffer. This buffer is intended as the rendering
  112. destination for the pass.</p></td>
  113. </tr>
  114. <tr>
  115. <td class="name"><code>readBuffer</code></td>
  116. <td class="description last"><p>The read buffer. The pass can access the result from the
  117. previous pass from this buffer.</p></td>
  118. </tr>
  119. <tr>
  120. <td class="name"><code>deltaTime</code></td>
  121. <td class="description last"><p>The delta time in seconds.</p></td>
  122. </tr>
  123. <tr>
  124. <td class="name"><code>maskActive</code></td>
  125. <td class="description last"><p>Whether masking is active or not.</p></td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. <dl class="details">
  130. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  131. </dl>
  132. </div>
  133. <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>
  134. <div class="method">
  135. <div class="description">
  136. <p>Sets the size of the pass.</p>
  137. </div>
  138. <table class="params">
  139. <tbody>
  140. <tr>
  141. <td class="name"><code>width</code></td>
  142. <td class="description last"><p>The width to set.</p></td>
  143. </tr>
  144. <tr>
  145. <td class="name"><code>height</code></td>
  146. <td class="description last"><p>The height to set.</p></td>
  147. </tr>
  148. </tbody>
  149. </table>
  150. <dl class="details">
  151. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#setSize">Pass#setSize</a></dt>
  152. </dl>
  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/BloomPass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/BloomPass.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号