VaryingNode.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>VaryingNode - 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> → </p>
  13. <h1 translate="no">VaryingNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Class for representing shader varyings as nodes. Varyings are create from
  17. existing nodes like the following:</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const positionLocal = positionGeometry.toVarying( 'vPositionLocal' );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="VaryingNode" translate="no">new <a href="#VaryingNode">VaryingNode</a><span class="signature">( node : <span class="param-type"><a href="Node.html">Node</a></span>, name : <span class="param-type">string</span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new varying node.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>node</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The node for which a varying should be created.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong>name</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The name of the varying in the shader.</p>
  46. <p>Default is <code>null</code>.</p>
  47. </td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53. <h2 class="subsection-title">Properties</h2>
  54. <div class="member">
  55. <h3 class="name" id="global" translate="no">.<a href="#global">global</a><span class="type-signature"> : boolean</span> </h3>
  56. <div class="description">
  57. <p>This flag is used for global cache.</p>
  58. <p>Default is <code>true</code>.</p>
  59. </div>
  60. <dl class="details">
  61. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#global">Node#global</a></dt>
  62. </dl>
  63. </div>
  64. <div class="member">
  65. <h3 class="name" id="interpolationSampling" translate="no">.<a href="#interpolationSampling">interpolationSampling</a><span class="type-signature"> : string</span> </h3>
  66. <div class="description">
  67. <p>The interpolation sampling type of varying data.</p>
  68. <p>Default is <code>null</code>.</p>
  69. </div>
  70. </div>
  71. <div class="member">
  72. <h3 class="name" id="interpolationType" translate="no">.<a href="#interpolationType">interpolationType</a><span class="type-signature"> : string</span> </h3>
  73. <div class="description">
  74. <p>The interpolation type of the varying data.</p>
  75. <p>Default is <code>null</code>.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="isVaryingNode" translate="no">.<a href="#isVaryingNode">isVaryingNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  80. <div class="description">
  81. <p>This flag can be used for type testing.</p>
  82. <p>Default is <code>true</code>.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  87. <div class="description">
  88. <p>The name of the varying in the shader. If no name is defined,
  89. the node system auto-generates one.</p>
  90. <p>Default is <code>null</code>.</p>
  91. </div>
  92. <dl class="details">
  93. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#name">Node#name</a></dt>
  94. </dl>
  95. </div>
  96. <div class="member">
  97. <h3 class="name" id="node" translate="no">.<a href="#node">node</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  98. <div class="description">
  99. <p>The node for which a varying should be created.</p>
  100. </div>
  101. </div>
  102. <h2 class="subsection-title">Methods</h2>
  103. <h3 class="name name-method" id="setInterpolation" translate="no">.<a href="#setInterpolation">setInterpolation</a><span class="signature">( type : <span class="param-type">string</span>, sampling : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="VaryingNode.html">VaryingNode</a></span> </h3>
  104. <div class="method">
  105. <div class="description">
  106. <p>Defines the interpolation type of the varying.</p>
  107. </div>
  108. <table class="params">
  109. <tbody>
  110. <tr>
  111. <td class="name">
  112. <strong>type</strong>
  113. </td>
  114. <td class="description last">
  115. <p>The interpolation type.</p>
  116. </td>
  117. </tr>
  118. <tr>
  119. <td class="name">
  120. <strong>sampling</strong>
  121. </td>
  122. <td class="description last">
  123. <p>The interpolation sampling type</p>
  124. <p>Default is <code>null</code>.</p>
  125. </td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. <dl class="details">
  130. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  131. </dl>
  132. </div>
  133. <h3 class="name name-method" id="setupVarying" translate="no">.<a href="#setupVarying">setupVarying</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : <a href="NodeVarying.html">NodeVarying</a></span> </h3>
  134. <div class="method">
  135. <div class="description">
  136. <p>This method performs the setup of a varying node with the current node builder.</p>
  137. </div>
  138. <table class="params">
  139. <tbody>
  140. <tr>
  141. <td class="name">
  142. <strong>builder</strong>
  143. </td>
  144. <td class="description last">
  145. <p>The current node builder.</p>
  146. </td>
  147. </tr>
  148. </tbody>
  149. </table>
  150. <dl class="details">
  151. <dt class="tag-returns"><strong>Returns:</strong> The node varying from the node builder.</dt>
  152. </dl>
  153. </div>
  154. <h2 class="subsection-title">Source</h2>
  155. <p>
  156. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/VaryingNode.js" translate="no" target="_blank" rel="noopener">src/nodes/core/VaryingNode.js</a>
  157. </p>
  158. </article>
  159. </section>
  160. <script src="../scripts/linenumber.js"></script>
  161. <script src="../scripts/page.js"></script>
  162. </body>
  163. </html>
粤ICP备19079148号