1
0

DenoiseNode.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>DenoiseNode - 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="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="TempNode.html">TempNode</a> → </p>
  13. <h1 translate="no">DenoiseNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for denoising data like raw screen-space ambient occlusion output.
  17. Denoise can noticeably improve the quality of ambient occlusion but also add quite some
  18. overhead to the post processing setup. It's best to make its usage optional (e.g. via
  19. graphic settings).</p>
  20. <p>Reference: <a href="https://openaccess.thecvf.com/content/WACV2021/papers/Khademi_Self-Supervised_Poisson-Gaussian_Denoising_WACV_2021_paper.pdf" target="_blank" rel="noopener">https://openaccess.thecvf.com/content/WACV2021/papers/Khademi_Self-Supervised_Poisson-Gaussian_Denoising_WACV_2021_paper.pdf</a>.</p></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">DenoiseNode</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>
  25. <pre><code class="language-js">import { denoise } from 'three/addons/tsl/display/DenoiseNode.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="DenoiseNode" translate="no">new <a href="#DenoiseNode">DenoiseNode</a><span class="signature">( textureNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, depthNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span>, normalNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec3></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new denoise node.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>textureNode</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The texture node that represents the input of the effect (e.g. AO).</p>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="name">
  45. <strong>depthNode</strong>
  46. </td>
  47. <td class="description last">
  48. <p>A node that represents the scene's depth.</p>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td class="name">
  53. <strong>normalNode</strong>
  54. </td>
  55. <td class="description last">
  56. <p>A node that represents the scene's normals.</p>
  57. </td>
  58. </tr>
  59. <tr>
  60. <td class="name">
  61. <strong>camera</strong>
  62. </td>
  63. <td class="description last">
  64. <p>The camera the scene is rendered with.</p>
  65. </td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. </div>
  70. </div>
  71. <h2 class="subsection-title">Properties</h2>
  72. <div class="member">
  73. <h3 class="name" id="depthNode" translate="no">.<a href="#depthNode">depthNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  74. <div class="description">
  75. <p>A node that represents the scene's depth.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="depthPhi" translate="no">.<a href="#depthPhi">depthPhi</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  80. <div class="description">
  81. <p>The depth Phi value.</p>
  82. </div>
  83. </div>
  84. <div class="member">
  85. <h3 class="name" id="index" translate="no">.<a href="#index">index</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  86. <div class="description">
  87. <p>The index.</p>
  88. </div>
  89. </div>
  90. <div class="member">
  91. <h3 class="name" id="lumaPhi" translate="no">.<a href="#lumaPhi">lumaPhi</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  92. <div class="description">
  93. <p>The luma Phi value.</p>
  94. </div>
  95. </div>
  96. <div class="member">
  97. <h3 class="name" id="noiseNode" translate="no">.<a href="#noiseNode">noiseNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  98. <div class="description">
  99. <p>The node represents the internal noise texture.</p>
  100. </div>
  101. </div>
  102. <div class="member">
  103. <h3 class="name" id="normalNode" translate="no">.<a href="#normalNode">normalNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec3></span> </h3>
  104. <div class="description">
  105. <p>A node that represents the scene's normals. If no normals are passed to the
  106. constructor (because MRT is not available), normals can be automatically
  107. reconstructed from depth values in the shader.</p>
  108. </div>
  109. </div>
  110. <div class="member">
  111. <h3 class="name" id="normalPhi" translate="no">.<a href="#normalPhi">normalPhi</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  112. <div class="description">
  113. <p>The normal Phi value.</p>
  114. </div>
  115. </div>
  116. <div class="member">
  117. <h3 class="name" id="radius" translate="no">.<a href="#radius">radius</a><span class="type-signature"> : <a href="UniformNode.html">UniformNode</a>.&lt;float></span> </h3>
  118. <div class="description">
  119. <p>The radius.</p>
  120. </div>
  121. </div>
  122. <div class="member">
  123. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  124. <div class="description">
  125. <p>The texture node that represents the input of the effect (e.g. AO).</p>
  126. </div>
  127. </div>
  128. <div class="member">
  129. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  130. <div class="description">
  131. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node updates
  132. its internal uniforms once per frame in <code>updateBefore()</code>.</p>
  133. <p>Default is <code>'frame'</code>.</p>
  134. </div>
  135. <dl class="details">
  136. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  137. </dl>
  138. </div>
  139. <h2 class="subsection-title">Methods</h2>
  140. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : ShaderCallNodeInternal</span> </h3>
  141. <div class="method">
  142. <div class="description">
  143. <p>This method is used to setup the effect's TSL code.</p>
  144. </div>
  145. <table class="params">
  146. <tbody>
  147. <tr>
  148. <td class="name">
  149. <strong>builder</strong>
  150. </td>
  151. <td class="description last">
  152. <p>The current node builder.</p>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. <dl class="details">
  158. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  159. </dl>
  160. </div>
  161. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  162. <div class="method">
  163. <div class="description">
  164. <p>This method is used to update internal uniforms once per frame.</p>
  165. </div>
  166. <table class="params">
  167. <tbody>
  168. <tr>
  169. <td class="name">
  170. <strong>frame</strong>
  171. </td>
  172. <td class="description last">
  173. <p>The current node frame.</p>
  174. </td>
  175. </tr>
  176. </tbody>
  177. </table>
  178. <dl class="details">
  179. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  180. </dl>
  181. </div>
  182. <h2 class="subsection-title">Source</h2>
  183. <p>
  184. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/DenoiseNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/DenoiseNode.js</a>
  185. </p>
  186. </article>
  187. </section>
  188. <script src="../scripts/linenumber.js"></script>
  189. <script src="../scripts/page.js"></script>
  190. </body>
  191. </html>
粤ICP备19079148号