ChromaticAberrationNode.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ChromaticAberrationNode - 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">ChromaticAberrationNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for applying chromatic aberration effect.
  17. This effect simulates the color fringing that occurs in real camera lenses
  18. by separating and offsetting the red, green, and blue channels.</p></div>
  19. </header>
  20. <article>
  21. <h2 class="subsection-title">Import</h2>
  22. <p><span translate="no">ChromaticAberrationNode</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>
  23. <pre><code class="language-js">import { chromaticAberration } from 'three/addons/tsl/display/ChromaticAberrationNode.js';</code></pre>
  24. <div class="container-overview">
  25. <h2>Constructor</h2>
  26. <h3 class="name name-method" id="ChromaticAberrationNode" translate="no">new <a href="#ChromaticAberrationNode">ChromaticAberrationNode</a><span class="signature">( textureNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, strengthNode : <span class="param-type"><a href="Node.html">Node</a></span>, centerNode : <span class="param-type"><a href="Node.html">Node</a></span>, scaleNode : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Constructs a new chromatic aberration node.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name">
  35. <strong translate="no">textureNode</strong>
  36. </td>
  37. <td class="description last">
  38. <p>The texture node that represents the input of the effect.</p>
  39. </td>
  40. </tr>
  41. <tr>
  42. <td class="name">
  43. <strong translate="no">strengthNode</strong>
  44. </td>
  45. <td class="description last">
  46. <p>The strength of the chromatic aberration effect as a node.</p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="name">
  51. <strong translate="no">centerNode</strong>
  52. </td>
  53. <td class="description last">
  54. <p>The center point of the effect as a node.</p>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td class="name">
  59. <strong translate="no">scaleNode</strong>
  60. </td>
  61. <td class="description last">
  62. <p>The scale factor for stepped scaling from center as a node.</p>
  63. </td>
  64. </tr>
  65. </tbody>
  66. </table>
  67. </div>
  68. </div>
  69. <h2 class="subsection-title">Properties</h2>
  70. <div class="member">
  71. <h3 class="name" id="centerNode" translate="no">.<a href="#centerNode">centerNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  72. <div class="description">
  73. <p>A node holding the center point of the effect.</p>
  74. </div>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="scaleNode" translate="no">.<a href="#scaleNode">scaleNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  78. <div class="description">
  79. <p>A node holding the scale factor for stepped scaling.</p>
  80. </div>
  81. </div>
  82. <div class="member">
  83. <h3 class="name" id="strengthNode" translate="no">.<a href="#strengthNode">strengthNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  84. <div class="description">
  85. <p>A node holding the strength of the effect.</p>
  86. </div>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="global.html#texture">texture</a></span> </h3>
  90. <div class="description">
  91. <p>The texture node that represents the input of the effect.</p>
  92. </div>
  93. </div>
  94. <div class="member">
  95. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  96. <div class="description">
  97. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node updates
  98. its internal uniforms once per frame in <code>updateBefore()</code>.</p>
  99. <p>Default is <code>'frame'</code>.</p>
  100. </div>
  101. <dl class="details">
  102. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  103. </dl>
  104. </div>
  105. <h2 class="subsection-title">Methods</h2>
  106. <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"> : ShaderCallNodeInternal</span> </h3>
  107. <div class="method">
  108. <div class="description">
  109. <p>This method is used to setup the effect's TSL code.</p>
  110. </div>
  111. <table class="params">
  112. <tbody>
  113. <tr>
  114. <td class="name">
  115. <strong translate="no">builder</strong>
  116. </td>
  117. <td class="description last">
  118. <p>The current node builder.</p>
  119. </td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. <dl class="details">
  124. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  125. </dl>
  126. </div>
  127. <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>
  128. <div class="method">
  129. <div class="description">
  130. <p>This method is used to update the effect's uniforms once per frame.</p>
  131. </div>
  132. <table class="params">
  133. <tbody>
  134. <tr>
  135. <td class="name">
  136. <strong translate="no">frame</strong>
  137. </td>
  138. <td class="description last">
  139. <p>The current node frame.</p>
  140. </td>
  141. </tr>
  142. </tbody>
  143. </table>
  144. <dl class="details">
  145. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  146. </dl>
  147. </div>
  148. <h2 class="subsection-title">Source</h2>
  149. <p>
  150. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/ChromaticAberrationNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/ChromaticAberrationNode.js</a>
  151. </p>
  152. </article>
  153. </section>
  154. <script src="../scripts/linenumber.js"></script>
  155. <script src="../scripts/page.js"></script>
  156. </body>
  157. </html>
粤ICP备19079148号