SMAANode.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SMAANode - 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">SMAANode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for applying SMAA. Unlike FXAA, this node
  17. should be applied before converting colors to sRGB. SMAA should produce
  18. better results than FXAA but is also more expensive to execute.</p>
  19. <p>Used Preset: SMAA 1x Medium (with color edge detection)
  20. Reference: <a href="https://github.com/iryoku/smaa/releases/tag/v2.8" target="_blank" rel="noopener">https://github.com/iryoku/smaa/releases/tag/v2.8</a>.</p></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">SMAANode</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 { smaa } from 'three/addons/tsl/display/SMAANode.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="SMAANode" translate="no">new <a href="#SMAANode">SMAANode</a><span class="signature">( textureNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new SMAA 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.</p>
  41. </td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <h2 class="subsection-title">Properties</h2>
  48. <div class="member">
  49. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  50. <div class="description">
  51. <p>The texture node that represents the input of the effect.</p>
  52. </div>
  53. </div>
  54. <div class="member">
  55. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  56. <div class="description">
  57. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
  58. its effect once per frame in <code>updateBefore()</code>.</p>
  59. <p>Default is <code>'frame'</code>.</p>
  60. </div>
  61. <dl class="details">
  62. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  63. </dl>
  64. </div>
  65. <h2 class="subsection-title">Methods</h2>
  66. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  67. <div class="method">
  68. <div class="description">
  69. <p>Frees internal resources. This method should be called
  70. when the effect is no longer required.</p>
  71. </div>
  72. <dl class="details">
  73. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  74. </dl>
  75. </div>
  76. <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>
  77. <div class="method">
  78. <div class="description">
  79. <p>Returns the result of the effect as a texture node.</p>
  80. </div>
  81. <dl class="details">
  82. <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
  83. </dl>
  84. </div>
  85. <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>
  86. <div class="method">
  87. <div class="description">
  88. <p>Sets the size of the effect.</p>
  89. </div>
  90. <table class="params">
  91. <tbody>
  92. <tr>
  93. <td class="name">
  94. <strong>width</strong>
  95. </td>
  96. <td class="description last">
  97. <p>The width of the effect.</p>
  98. </td>
  99. </tr>
  100. <tr>
  101. <td class="name">
  102. <strong>height</strong>
  103. </td>
  104. <td class="description last">
  105. <p>The height of the effect.</p>
  106. </td>
  107. </tr>
  108. </tbody>
  109. </table>
  110. </div>
  111. <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>
  112. <div class="method">
  113. <div class="description">
  114. <p>This method is used to setup the effect's TSL code.</p>
  115. </div>
  116. <table class="params">
  117. <tbody>
  118. <tr>
  119. <td class="name">
  120. <strong>builder</strong>
  121. </td>
  122. <td class="description last">
  123. <p>The current node builder.</p>
  124. </td>
  125. </tr>
  126. </tbody>
  127. </table>
  128. <dl class="details">
  129. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  130. </dl>
  131. </div>
  132. <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>
  133. <div class="method">
  134. <div class="description">
  135. <p>This method is used to render the effect once per frame.</p>
  136. </div>
  137. <table class="params">
  138. <tbody>
  139. <tr>
  140. <td class="name">
  141. <strong>frame</strong>
  142. </td>
  143. <td class="description last">
  144. <p>The current node frame.</p>
  145. </td>
  146. </tr>
  147. </tbody>
  148. </table>
  149. <dl class="details">
  150. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  151. </dl>
  152. </div>
  153. <h2 class="subsection-title">Source</h2>
  154. <p>
  155. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/SMAANode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/SMAANode.js</a>
  156. </p>
  157. </article>
  158. </section>
  159. <script src="../scripts/linenumber.js"></script>
  160. <script src="../scripts/page.js"></script>
  161. </body>
  162. </html>
粤ICP备19079148号