AnamorphicNode.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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">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">TextureNode</span>, thresholdNode : <span class="param-type">Node.&lt;float></span>, scaleNode : <span class="param-type">Node.&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"><code>textureNode</code></td>
  33. <td class="description last"><p>The texture node that represents the input of the effect.</p></td>
  34. </tr>
  35. <tr>
  36. <td class="name"><code>thresholdNode</code></td>
  37. <td class="description last"><p>The threshold is one option to control the intensity and size of the effect.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>scaleNode</code></td>
  41. <td class="description last"><p>Defines the vertical scale of the flares.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>samples</code></td>
  45. <td class="description last"><p>More samples result in larger flares and a more expensive runtime behavior.</p></td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. <h2 class="subsection-title">Properties</h2>
  52. <div class="member">
  53. <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>
  54. <div class="description">
  55. <p>The color of the flares.</p>
  56. </div>
  57. </div>
  58. <div class="member">
  59. <h3 class="name" id="resolution" translate="no">.<a href="#resolution">resolution</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  60. <div class="description">
  61. <p>The resolution scale.<br/>Default is <code>{(1,1)}</code>.</p>
  62. </div>
  63. <dl class="details">
  64. <dt class="important tag-deprecated"><strong>Deprecated:</strong> Yes</dt>
  65. </dl>
  66. </div>
  67. <div class="member">
  68. <h3 class="name" id="resolutionScale" translate="no">.<a href="#resolutionScale">resolutionScale</a><span class="type-signature"> : number</span> </h3>
  69. <div class="description">
  70. <p>The resolution scale.</p>
  71. </div>
  72. </div>
  73. <div class="member">
  74. <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>
  75. <div class="description">
  76. <p>More samples result in larger flares and a more expensive runtime behavior.</p>
  77. </div>
  78. </div>
  79. <div class="member">
  80. <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>
  81. <div class="description">
  82. <p>Defines the vertical scale of the flares.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  87. <div class="description">
  88. <p>The texture node that represents the input of the effect.</p>
  89. </div>
  90. </div>
  91. <div class="member">
  92. <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>
  93. <div class="description">
  94. <p>The threshold is one option to control the intensity and size of the effect.</p>
  95. </div>
  96. </div>
  97. <div class="member">
  98. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  99. <div class="description">
  100. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders
  101. its effect once per frame in <code>updateBefore()</code>.<br/>Default is <code>'frame'</code>.</p>
  102. </div>
  103. <dl class="details">
  104. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  105. </dl>
  106. </div>
  107. <h2 class="subsection-title">Methods</h2>
  108. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  109. <div class="method">
  110. <div class="description">
  111. <p>Frees internal resources. This method should be called
  112. when the effect is no longer required.</p>
  113. </div>
  114. <dl class="details">
  115. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  116. </dl>
  117. </div>
  118. <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>
  119. <div class="method">
  120. <div class="description">
  121. <p>Returns the result of the effect as a texture node.</p>
  122. </div>
  123. <dl class="details">
  124. <dt class="tag-returns"><strong>Returns:</strong> A texture node that represents the result of the effect.</dt>
  125. </dl>
  126. </div>
  127. <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>
  128. <div class="method">
  129. <div class="description">
  130. <p>Sets the size of the effect.</p>
  131. </div>
  132. <table class="params">
  133. <tbody>
  134. <tr>
  135. <td class="name"><code>width</code></td>
  136. <td class="description last"><p>The width of the effect.</p></td>
  137. </tr>
  138. <tr>
  139. <td class="name"><code>height</code></td>
  140. <td class="description last"><p>The height of the effect.</p></td>
  141. </tr>
  142. </tbody>
  143. </table>
  144. </div>
  145. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  146. <div class="method">
  147. <div class="description">
  148. <p>This method is used to setup the effect's TSL code.</p>
  149. </div>
  150. <table class="params">
  151. <tbody>
  152. <tr>
  153. <td class="name"><code>builder</code></td>
  154. <td class="description last"><p>The current node builder.</p></td>
  155. </tr>
  156. </tbody>
  157. </table>
  158. <dl class="details">
  159. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  160. </dl>
  161. <dl class="details">
  162. <dt class="tag-returns"><strong>Returns:</strong> </dt>
  163. </dl>
  164. </div>
  165. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type">NodeFrame</span> )</span> </h3>
  166. <div class="method">
  167. <div class="description">
  168. <p>This method is used to render the effect once per frame.</p>
  169. </div>
  170. <table class="params">
  171. <tbody>
  172. <tr>
  173. <td class="name"><code>frame</code></td>
  174. <td class="description last"><p>The current node frame.</p></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/AnamorphicNode.js" target="_blank" rel="noopener" translate="no">examples/jsm/tsl/display/AnamorphicNode.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号