OutputPass.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>OutputPass - 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">OutputPass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This pass is responsible for including tone mapping and color space conversion
  17. into your pass chain. In most cases, this pass should be included at the end
  18. of each pass chain. If a pass requires sRGB input (e.g. like FXAA), the pass
  19. must follow <code>OutputPass</code> in the pass chain.</p>
  20. <p>The tone mapping and color space settings are extracted from the renderer.</p></div>
  21. <h2>Code Example</h2>
  22. <div translate="no"><pre><code class="language-js">const outputPass = new OutputPass();
  23. composer.addPass( outputPass );
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <h2 class="subsection-title">Import</h2>
  28. <p><span translate="no">OutputPass</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>
  29. <pre><code class="language-js">import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';</code></pre>
  30. <div class="container-overview">
  31. <h2>Constructor</h2>
  32. <h3 class="name name-method" id="OutputPass" translate="no">new <a href="#OutputPass">OutputPass</a><span class="signature">()</span> </h3>
  33. <div class="method">
  34. <div class="description">
  35. <p>Constructs a new output pass.</p>
  36. </div>
  37. </div>
  38. </div>
  39. <h2 class="subsection-title">Properties</h2>
  40. <div class="member">
  41. <h3 class="name" id="material" translate="no">.<a href="#material">material</a><span class="type-signature"> : <a href="RawShaderMaterial.html">RawShaderMaterial</a></span> </h3>
  42. <div class="description">
  43. <p>The pass material.</p>
  44. </div>
  45. </div>
  46. <div class="member">
  47. <h3 class="name" id="uniforms" translate="no">.<a href="#uniforms">uniforms</a><span class="type-signature"> : Object</span> </h3>
  48. <div class="description">
  49. <p>The pass uniforms.</p>
  50. </div>
  51. </div>
  52. <h2 class="subsection-title">Methods</h2>
  53. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  54. <div class="method">
  55. <div class="description">
  56. <p>Frees the GPU-related resources allocated by this instance. Call this
  57. method whenever the pass is no longer used in your app.</p>
  58. </div>
  59. <dl class="details">
  60. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  61. </dl>
  62. </div>
  63. <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>
  64. <div class="method">
  65. <div class="description">
  66. <p>Performs the output pass.</p>
  67. </div>
  68. <table class="params">
  69. <tbody>
  70. <tr>
  71. <td class="name">
  72. <strong>renderer</strong>
  73. </td>
  74. <td class="description last">
  75. <p>The renderer.</p>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td class="name">
  80. <strong>writeBuffer</strong>
  81. </td>
  82. <td class="description last">
  83. <p>The write buffer. This buffer is intended as the rendering
  84. destination for the pass.</p>
  85. </td>
  86. </tr>
  87. <tr>
  88. <td class="name">
  89. <strong>readBuffer</strong>
  90. </td>
  91. <td class="description last">
  92. <p>The read buffer. The pass can access the result from the
  93. previous pass from this buffer.</p>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td class="name">
  98. <strong>deltaTime</strong>
  99. </td>
  100. <td class="description last">
  101. <p>The delta time in seconds.</p>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td class="name">
  106. <strong>maskActive</strong>
  107. </td>
  108. <td class="description last">
  109. <p>Whether masking is active or not.</p>
  110. </td>
  111. </tr>
  112. </tbody>
  113. </table>
  114. <dl class="details">
  115. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  116. </dl>
  117. </div>
  118. <h2 class="subsection-title">Source</h2>
  119. <p>
  120. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/OutputPass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/OutputPass.js</a>
  121. </p>
  122. </article>
  123. </section>
  124. <script src="../scripts/linenumber.js"></script>
  125. <script src="../scripts/page.js"></script>
  126. </body>
  127. </html>
粤ICP备19079148号