1
0

PostProcessing.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PostProcessing - 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">PostProcessing</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This module is responsible to manage the post processing setups in apps.
  16. You usually create a single instance of this class and use it to define
  17. the output of your post processing effect chain.</p>
  18. <p>Note: This module can only be used with <code>WebGPURenderer</code>.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const postProcessing = new PostProcessing( renderer );
  21. const scenePass = pass( scene, camera );
  22. postProcessing.outputNode = scenePass;
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="PostProcessing" translate="no">new <a href="#PostProcessing">PostProcessing</a><span class="signature">( renderer : <span class="param-type"><a href="Renderer.html">Renderer</a></span>, outputNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec4></span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new post processing management module.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>renderer</strong>
  38. </td>
  39. <td class="description last">
  40. <p>A reference to the renderer.</p>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="name">
  45. <strong>outputNode</strong>
  46. </td>
  47. <td class="description last">
  48. <p>An optional output node.</p>
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Properties</h2>
  56. <div class="member">
  57. <h3 class="name" id="context" translate="no">.<a href="#context">context</a><span class="type-signature"> : Object</span> <span class="type-signature">(readonly) </span></h3>
  58. <div class="description">
  59. <p>Returns the current context of the post processing stack.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="needsUpdate" translate="no">.<a href="#needsUpdate">needsUpdate</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec4></span> </h3>
  64. <div class="description">
  65. <p>Must be set to <code>true</code> when the output node changes.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="outputColorTransform" translate="no">.<a href="#outputColorTransform">outputColorTransform</a><span class="type-signature"> : boolean</span> </h3>
  70. <div class="description">
  71. <p>Whether the default output tone mapping and color
  72. space transformation should be enabled or not.</p>
  73. <p>It is enabled by default by it must be disabled when
  74. effects must be executed after tone mapping and color
  75. space conversion. A typical example is FXAA which
  76. requires sRGB input.</p>
  77. <p>When set to <code>false</code>, the app must control the output
  78. transformation with <code>RenderOutputNode</code>.</p>
  79. <pre><code class="language-js">const outputPass = renderOutput( scenePass );
  80. </code></pre>
  81. </div>
  82. </div>
  83. <div class="member">
  84. <h3 class="name" id="outputNode" translate="no">.<a href="#outputNode">outputNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec4></span> </h3>
  85. <div class="description">
  86. <p>A node which defines the final output of the post
  87. processing. This is usually the last node in a chain
  88. of effect nodes.</p>
  89. </div>
  90. </div>
  91. <div class="member">
  92. <h3 class="name" id="renderer" translate="no">.<a href="#renderer">renderer</a><span class="type-signature"> : <a href="Renderer.html">Renderer</a></span> </h3>
  93. <div class="description">
  94. <p>A reference to the renderer.</p>
  95. </div>
  96. </div>
  97. <h2 class="subsection-title">Methods</h2>
  98. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  99. <div class="method">
  100. <div class="description">
  101. <p>Frees internal resources.</p>
  102. </div>
  103. </div>
  104. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">()</span> </h3>
  105. <div class="method">
  106. <div class="description">
  107. <p>When <code>PostProcessing</code> is used to apply post processing effects,
  108. the application must use this version of <code>render()</code> inside
  109. its animation loop (not the one from the renderer).</p>
  110. </div>
  111. </div>
  112. <h3 class="name name-method" id="renderAsync" translate="no">.<a href="#renderAsync">renderAsync</a><span class="signature">()</span><span class="type-signature"> : Promise</span> <span class="type-signature">(async) </span></h3>
  113. <div class="method">
  114. <div class="description">
  115. <p>When <code>PostProcessing</code> is used to apply post processing effects,
  116. the application must use this version of <code>renderAsync()</code> inside
  117. its animation loop (not the one from the renderer).</p>
  118. </div>
  119. <dl class="details">
  120. <dt class="important tag-deprecated"><strong>Deprecated:</strong> Yes</dt>
  121. </dl>
  122. <dl class="details">
  123. <dt class="tag-returns"><strong>Returns:</strong> A Promise that resolves when the render has been finished.</dt>
  124. </dl>
  125. </div>
  126. <h2 class="subsection-title">Source</h2>
  127. <p>
  128. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/common/PostProcessing.js" translate="no" target="_blank" rel="noopener">src/renderers/common/PostProcessing.js</a>
  129. </p>
  130. </article>
  131. </section>
  132. <script src="../scripts/linenumber.js"></script>
  133. <script src="../scripts/page.js"></script>
  134. </body>
  135. </html>
粤ICP备19079148号