VaryingNode.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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">Node</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"><code>node</code></td>
  34. <td class="description last"><p>The node for which a varying should be created.</p></td>
  35. </tr>
  36. <tr>
  37. <td class="name"><code>name</code></td>
  38. <td class="description last"><p>The name of the varying in the shader.<br/>Default is <code>null</code>.</p></td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Properties</h2>
  45. <div class="member">
  46. <h3 class="name" id="global" translate="no">.<a href="#global">global</a><span class="type-signature"> : boolean</span> </h3>
  47. <div class="description">
  48. <p>This flag is used for global cache.<br/>Default is <code>true</code>.</p>
  49. </div>
  50. <dl class="details">
  51. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#global">Node#global</a></dt>
  52. </dl>
  53. </div>
  54. <div class="member">
  55. <h3 class="name" id="interpolationSampling" translate="no">.<a href="#interpolationSampling">interpolationSampling</a><span class="type-signature"> : string</span> </h3>
  56. <div class="description">
  57. <p>The interpolation sampling type of varying data.<br/>Default is <code>null</code>.</p>
  58. </div>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="interpolationType" translate="no">.<a href="#interpolationType">interpolationType</a><span class="type-signature"> : string</span> </h3>
  62. <div class="description">
  63. <p>The interpolation type of the varying data.<br/>Default is <code>null</code>.</p>
  64. </div>
  65. </div>
  66. <div class="member">
  67. <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>
  68. <div class="description">
  69. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  70. </div>
  71. </div>
  72. <div class="member">
  73. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  74. <div class="description">
  75. <p>The name of the varying in the shader. If no name is defined,
  76. the node system auto-generates one.<br/>Default is <code>null</code>.</p>
  77. </div>
  78. <dl class="details">
  79. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#name">Node#name</a></dt>
  80. </dl>
  81. </div>
  82. <div class="member">
  83. <h3 class="name" id="node" translate="no">.<a href="#node">node</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  84. <div class="description">
  85. <p>The node for which a varying should be created.</p>
  86. </div>
  87. </div>
  88. <h2 class="subsection-title">Methods</h2>
  89. <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>
  90. <div class="method">
  91. <div class="description">
  92. <p>Defines the interpolation type of the varying.</p>
  93. </div>
  94. <table class="params">
  95. <tbody>
  96. <tr>
  97. <td class="name"><code>type</code></td>
  98. <td class="description last"><p>The interpolation type.</p></td>
  99. </tr>
  100. <tr>
  101. <td class="name"><code>sampling</code></td>
  102. <td class="description last"><p>The interpolation sampling type<br/>Default is <code>null</code>.</p></td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. <dl class="details">
  107. <dt class="tag-returns"><strong>Returns:</strong> A reference to this node.</dt>
  108. </dl>
  109. </div>
  110. <h3 class="name name-method" id="setupVarying" translate="no">.<a href="#setupVarying">setupVarying</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : <a href="NodeVarying.html">NodeVarying</a></span> </h3>
  111. <div class="method">
  112. <div class="description">
  113. <p>This method performs the setup of a varying node with the current node builder.</p>
  114. </div>
  115. <table class="params">
  116. <tbody>
  117. <tr>
  118. <td class="name"><code>builder</code></td>
  119. <td class="description last"><p>The current node builder.</p></td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. <dl class="details">
  124. <dt class="tag-returns"><strong>Returns:</strong> The node varying from the node builder.</dt>
  125. </dl>
  126. </div>
  127. <h2 class="subsection-title">Source</h2>
  128. <p>
  129. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/core/VaryingNode.js" target="_blank" rel="noopener" translate="no">src/nodes/core/VaryingNode.js</a>
  130. </p>
  131. </article>
  132. </section>
  133. <script src="../scripts/linenumber.js"></script>
  134. <script src="../scripts/page.js"></script>
  135. </body>
  136. </html>
粤ICP备19079148号