SharpenNode.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SharpenNode - 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">SharpenNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for contrast-adaptive sharpening (RCAS).</p>
  17. <p>Reference: <a href="https://gpuopen.com/fidelityfx-superresolution/" target="_blank" rel="noopener">https://gpuopen.com/fidelityfx-superresolution/</a>.</p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <p><span translate="no">SharpenNode</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>
  22. <pre><code class="language-js">import { sharpen } from 'three/addons/tsl/display/SharpenNode.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="SharpenNode" translate="no">new <a href="#SharpenNode">SharpenNode</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>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new sharpen node.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong translate="no">textureNode</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The texture node that represents the input of the effect.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong translate="no">sharpness</strong>
  43. </td>
  44. <td class="description last">
  45. <p>Sharpening strength. 0 = maximum sharpening, 2 = no sharpening.</p>
  46. <p>Default is <code>0.2</code>.</p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="name">
  51. <strong translate="no">denoise</strong>
  52. </td>
  53. <td class="description last">
  54. <p>Whether to attenuate sharpening in noisy areas.</p>
  55. <p>Default is <code>false</code>.</p>
  56. </td>
  57. </tr>
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. <h2 class="subsection-title">Properties</h2>
  63. <div class="member">
  64. <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>
  65. <div class="description">
  66. <p>Whether to attenuate sharpening in noisy areas.</p>
  67. <p>Default is <code>false</code>.</p>
  68. </div>
  69. </div>
  70. <div class="member">
  71. <h3 class="name" id="isSharpenNode" translate="no">.<a href="#isSharpenNode">isSharpenNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  72. <div class="description">
  73. <p>This flag can be used for type testing.</p>
  74. <p>Default is <code>true</code>.</p>
  75. </div>
  76. </div>
  77. <div class="member">
  78. <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>
  79. <div class="description">
  80. <p>Sharpening strength. 0 = maximum, 2 = none.</p>
  81. <p>Default is <code>0.2</code>.</p>
  82. </div>
  83. </div>
  84. <div class="member">
  85. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  86. <div class="description">
  87. <p>The texture node that represents the input of the effect.</p>
  88. </div>
  89. </div>
  90. <div class="member">
  91. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  92. <div class="description">
  93. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
  94. its effect once per frame in <code>updateBefore()</code>.</p>
  95. <p>Default is <code>'frame'</code>.</p>
  96. </div>
  97. <dl class="details">
  98. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  99. </dl>
  100. </div>
  101. <h2 class="subsection-title">Methods</h2>
  102. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  103. <div class="method">
  104. <div class="description">
  105. <p>Frees internal resources. This method should be called
  106. when the effect is no longer required.</p>
  107. </div>
  108. <dl class="details">
  109. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  110. </dl>
  111. </div>
  112. <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>
  113. <div class="method">
  114. <div class="description">
  115. <p>Returns the result of the effect as a texture node.</p>
  116. </div>
  117. <dl class="details">
  118. <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
  119. </dl>
  120. </div>
  121. <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>
  122. <div class="method">
  123. <div class="description">
  124. <p>Sets the output size of the effect.</p>
  125. </div>
  126. <table class="params">
  127. <tbody>
  128. <tr>
  129. <td class="name">
  130. <strong translate="no">width</strong>
  131. </td>
  132. <td class="description last">
  133. <p>The width in pixels.</p>
  134. </td>
  135. </tr>
  136. <tr>
  137. <td class="name">
  138. <strong translate="no">height</strong>
  139. </td>
  140. <td class="description last">
  141. <p>The height in pixels.</p>
  142. </td>
  143. </tr>
  144. </tbody>
  145. </table>
  146. </div>
  147. <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>
  148. <div class="method">
  149. <div class="description">
  150. <p>This method is used to setup the effect's TSL code.</p>
  151. </div>
  152. <table class="params">
  153. <tbody>
  154. <tr>
  155. <td class="name">
  156. <strong translate="no">builder</strong>
  157. </td>
  158. <td class="description last">
  159. <p>The current node builder.</p>
  160. </td>
  161. </tr>
  162. </tbody>
  163. </table>
  164. <dl class="details">
  165. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  166. </dl>
  167. </div>
  168. <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>
  169. <div class="method">
  170. <div class="description">
  171. <p>This method is used to render the effect once per frame.</p>
  172. </div>
  173. <table class="params">
  174. <tbody>
  175. <tr>
  176. <td class="name">
  177. <strong translate="no">frame</strong>
  178. </td>
  179. <td class="description last">
  180. <p>The current node frame.</p>
  181. </td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. <dl class="details">
  186. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  187. </dl>
  188. </div>
  189. <h2 class="subsection-title">Source</h2>
  190. <p>
  191. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/SharpenNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/SharpenNode.js</a>
  192. </p>
  193. </article>
  194. </section>
  195. <script src="../scripts/linenumber.js"></script>
  196. <script src="../scripts/page.js"></script>
  197. </body>
  198. </html>
粤ICP备19079148号