AnamorphicNode.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>AnamorphicNode - 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">AnamorphicNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for adding an anamorphic flare effect.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">AnamorphicNode</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>
  21. <pre><code class="language-js">import { anamorphic } from 'three/addons/tsl/display/AnamorphicNode.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="AnamorphicNode" translate="no">new <a href="#AnamorphicNode">AnamorphicNode</a><span class="signature">( textureNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, thresholdNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span>, scaleNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span>, samples : <span class="param-type">number</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new anamorphic node.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>textureNode</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The texture node that represents the input of the effect.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong>thresholdNode</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The threshold is one option to control the intensity and size of the effect.</p>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class="name">
  49. <strong>scaleNode</strong>
  50. </td>
  51. <td class="description last">
  52. <p>Defines the vertical scale of the flares.</p>
  53. </td>
  54. </tr>
  55. <tr>
  56. <td class="name">
  57. <strong>samples</strong>
  58. </td>
  59. <td class="description last">
  60. <p>More samples result in larger flares and a more expensive runtime behavior.</p>
  61. </td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. </div>
  66. </div>
  67. <h2 class="subsection-title">Properties</h2>
  68. <div class="member">
  69. <h3 class="name" id="colorNode" translate="no">.<a href="#colorNode">colorNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec3></span> </h3>
  70. <div class="description">
  71. <p>The color of the flares.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="resolution" translate="no">.<a href="#resolution">resolution</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  76. <div class="description">
  77. <p>The resolution scale.</p>
  78. <p>Default is <code>{(1,1)}</code>.</p>
  79. </div>
  80. <dl class="details">
  81. <dt class="important tag-deprecated"><strong>Deprecated:</strong> Yes</dt>
  82. </dl>
  83. </div>
  84. <div class="member">
  85. <h3 class="name" id="resolutionScale" translate="no">.<a href="#resolutionScale">resolutionScale</a><span class="type-signature"> : number</span> </h3>
  86. <div class="description">
  87. <p>The resolution scale.</p>
  88. </div>
  89. </div>
  90. <div class="member">
  91. <h3 class="name" id="samples" translate="no">.<a href="#samples">samples</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  92. <div class="description">
  93. <p>More samples result in larger flares and a more expensive runtime behavior.</p>
  94. </div>
  95. </div>
  96. <div class="member">
  97. <h3 class="name" id="scaleNode" translate="no">.<a href="#scaleNode">scaleNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  98. <div class="description">
  99. <p>Defines the vertical scale of the flares.</p>
  100. </div>
  101. </div>
  102. <div class="member">
  103. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  104. <div class="description">
  105. <p>The texture node that represents the input of the effect.</p>
  106. </div>
  107. </div>
  108. <div class="member">
  109. <h3 class="name" id="thresholdNode" translate="no">.<a href="#thresholdNode">thresholdNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  110. <div class="description">
  111. <p>The threshold is one option to control the intensity and size of the effect.</p>
  112. </div>
  113. </div>
  114. <div class="member">
  115. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  116. <div class="description">
  117. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
  118. its effect once per frame in <code>updateBefore()</code>.</p>
  119. <p>Default is <code>'frame'</code>.</p>
  120. </div>
  121. <dl class="details">
  122. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  123. </dl>
  124. </div>
  125. <h2 class="subsection-title">Methods</h2>
  126. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  127. <div class="method">
  128. <div class="description">
  129. <p>Frees internal resources. This method should be called
  130. when the effect is no longer required.</p>
  131. </div>
  132. <dl class="details">
  133. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  134. </dl>
  135. </div>
  136. <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>
  137. <div class="method">
  138. <div class="description">
  139. <p>Returns the result of the effect as a texture node.</p>
  140. </div>
  141. <dl class="details">
  142. <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
  143. </dl>
  144. </div>
  145. <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>
  146. <div class="method">
  147. <div class="description">
  148. <p>Sets the size of the effect.</p>
  149. </div>
  150. <table class="params">
  151. <tbody>
  152. <tr>
  153. <td class="name">
  154. <strong>width</strong>
  155. </td>
  156. <td class="description last">
  157. <p>The width of the effect.</p>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td class="name">
  162. <strong>height</strong>
  163. </td>
  164. <td class="description last">
  165. <p>The height of the effect.</p>
  166. </td>
  167. </tr>
  168. </tbody>
  169. </table>
  170. </div>
  171. <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>
  172. <div class="method">
  173. <div class="description">
  174. <p>This method is used to setup the effect's TSL code.</p>
  175. </div>
  176. <table class="params">
  177. <tbody>
  178. <tr>
  179. <td class="name">
  180. <strong>builder</strong>
  181. </td>
  182. <td class="description last">
  183. <p>The current node builder.</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#setup">TempNode#setup</a></dt>
  190. </dl>
  191. </div>
  192. <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>
  193. <div class="method">
  194. <div class="description">
  195. <p>This method is used to render the effect once per frame.</p>
  196. </div>
  197. <table class="params">
  198. <tbody>
  199. <tr>
  200. <td class="name">
  201. <strong>frame</strong>
  202. </td>
  203. <td class="description last">
  204. <p>The current node frame.</p>
  205. </td>
  206. </tr>
  207. </tbody>
  208. </table>
  209. <dl class="details">
  210. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  211. </dl>
  212. </div>
  213. <h2 class="subsection-title">Source</h2>
  214. <p>
  215. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/AnamorphicNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/AnamorphicNode.js</a>
  216. </p>
  217. </article>
  218. </section>
  219. <script src="../scripts/linenumber.js"></script>
  220. <script src="../scripts/page.js"></script>
  221. </body>
  222. </html>
粤ICP备19079148号