FSR1Node.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>FSR1Node - 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">FSR1Node</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for applying AMD FidelityFX Super Resolution 1 (FSR 1).</p>
  17. <p>Combines two passes:</p>
  18. <ul>
  19. <li><strong>EASU</strong> (Edge-Adaptive Spatial Upsampling): Uses 12 texture samples in a cross pattern
  20. to detect local edge direction, then shapes an approximate Lanczos2 kernel into an
  21. ellipse aligned with the detected edge.</li>
  22. <li><strong>RCAS</strong> (Robust Contrast-Adaptive Sharpening): Uses a 5-tap cross pattern to apply
  23. contrast-aware sharpening that is automatically limited per-pixel to avoid artifacts.</li>
  24. </ul>
  25. <p>Note: Only use FSR 1 if your application is fragment-shader bound and cannot afford to render
  26. at full resolution. FSR 1 adds its own overhead, so simply shaded scenes will render faster
  27. at native resolution without it. Besides, FSR 1 should always be used with an anti-aliased
  28. source image.</p>
  29. <p>Reference: <a href="https://gpuopen.com/fidelityfx-superresolution/" target="_blank" rel="noopener">https://gpuopen.com/fidelityfx-superresolution/</a>.</p></div>
  30. </header>
  31. <article>
  32. <h2 class="subsection-title">Import</h2>
  33. <p><span translate="no">FSR1Node</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>
  34. <pre><code class="language-js">import { fsr1 } from 'three/addons/tsl/display/fsr1/FSR1Node.js';</code></pre>
  35. <div class="container-overview">
  36. <h2>Constructor</h2>
  37. <h3 class="name name-method" id="FSR1Node" translate="no">new <a href="#FSR1Node">FSR1Node</a><span class="signature">( textureNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, sharpness : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span>, denoise : <span class="param-type"><a href="Node.html">Node</a>.&lt;bool></span> )</span> </h3>
  38. <div class="method">
  39. <div class="description">
  40. <p>Constructs a new FSR 1 node.</p>
  41. </div>
  42. <table class="params">
  43. <tbody>
  44. <tr>
  45. <td class="name">
  46. <strong translate="no">textureNode</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The texture node that represents the input of the effect.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong translate="no">sharpness</strong>
  55. </td>
  56. <td class="description last">
  57. <p>RCAS sharpening strength. 0 = maximum sharpening, 2 = no sharpening.</p>
  58. <p>Default is <code>0.2</code>.</p>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td class="name">
  63. <strong translate="no">denoise</strong>
  64. </td>
  65. <td class="description last">
  66. <p>Whether to attenuate RCAS sharpening in noisy areas.</p>
  67. <p>Default is <code>false</code>.</p>
  68. </td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. </div>
  73. </div>
  74. <h2 class="subsection-title">Properties</h2>
  75. <div class="member">
  76. <h3 class="name" id="denoise" translate="no">.<a href="#denoise">denoise</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;bool></span> </h3>
  77. <div class="description">
  78. <p>Whether to attenuate RCAS sharpening in noisy areas.</p>
  79. </div>
  80. </div>
  81. <div class="member">
  82. <h3 class="name" id="sharpness" translate="no">.<a href="#sharpness">sharpness</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  83. <div class="description">
  84. <p>RCAS sharpening strength. 0 = maximum, 2 = none.</p>
  85. </div>
  86. </div>
  87. <div class="member">
  88. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  89. <div class="description">
  90. <p>The texture node that represents the input of the effect.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  95. <div class="description">
  96. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
  97. its effect once per frame in <code>updateBefore()</code>.</p>
  98. <p>Default is <code>'frame'</code>.</p>
  99. </div>
  100. <dl class="details">
  101. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  102. </dl>
  103. </div>
  104. <h2 class="subsection-title">Methods</h2>
  105. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  106. <div class="method">
  107. <div class="description">
  108. <p>Frees internal resources. This method should be called
  109. when the effect is no longer required.</p>
  110. </div>
  111. <dl class="details">
  112. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  113. </dl>
  114. </div>
  115. <h3 class="name name-method" id="getTextureNode" translate="no">.<a href="#getTextureNode">getTextureNode</a><span class="signature">()</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  116. <div class="method">
  117. <div class="description">
  118. <p>Returns the result of the effect as a texture node.</p>
  119. </div>
  120. <dl class="details">
  121. <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
  122. </dl>
  123. </div>
  124. <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>
  125. <div class="method">
  126. <div class="description">
  127. <p>Sets the output size of the effect.</p>
  128. </div>
  129. <table class="params">
  130. <tbody>
  131. <tr>
  132. <td class="name">
  133. <strong translate="no">width</strong>
  134. </td>
  135. <td class="description last">
  136. <p>The width in pixels.</p>
  137. </td>
  138. </tr>
  139. <tr>
  140. <td class="name">
  141. <strong translate="no">height</strong>
  142. </td>
  143. <td class="description last">
  144. <p>The height in pixels.</p>
  145. </td>
  146. </tr>
  147. </tbody>
  148. </table>
  149. </div>
  150. <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"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  151. <div class="method">
  152. <div class="description">
  153. <p>This method is used to setup the effect's TSL code.</p>
  154. </div>
  155. <table class="params">
  156. <tbody>
  157. <tr>
  158. <td class="name">
  159. <strong translate="no">builder</strong>
  160. </td>
  161. <td class="description last">
  162. <p>The current node builder.</p>
  163. </td>
  164. </tr>
  165. </tbody>
  166. </table>
  167. <dl class="details">
  168. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  169. </dl>
  170. </div>
  171. <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>
  172. <div class="method">
  173. <div class="description">
  174. <p>This method is used to render the effect once per frame.</p>
  175. </div>
  176. <table class="params">
  177. <tbody>
  178. <tr>
  179. <td class="name">
  180. <strong translate="no">frame</strong>
  181. </td>
  182. <td class="description last">
  183. <p>The current node frame.</p>
  184. </td>
  185. </tr>
  186. </tbody>
  187. </table>
  188. <dl class="details">
  189. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  190. </dl>
  191. </div>
  192. <h2 class="subsection-title">Source</h2>
  193. <p>
  194. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/FSR1Node.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/FSR1Node.js</a>
  195. </p>
  196. </article>
  197. </section>
  198. <script src="../scripts/linenumber.js"></script>
  199. <script src="../scripts/page.js"></script>
  200. </body>
  201. </html>
粤ICP备19079148号