MaterialNode.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MaterialNode - 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">MaterialNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class should simplify the node access to material properties.
  17. It internal uses reference nodes to make sure changes to material
  18. properties are automatically reflected to predefined TSL objects
  19. like e.g. <code>materialColor</code>.</p></div>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="MaterialNode" translate="no">new <a href="#MaterialNode">MaterialNode</a><span class="signature">( scope : <span class="param-type">string</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new material node.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>scope</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The scope defines what kind of material property is referred by the node.</p>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <h2 class="subsection-title">Properties</h2>
  44. <div class="member">
  45. <h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : string</span> </h3>
  46. <div class="description">
  47. <p>The scope defines what material property is referred by the node.</p>
  48. </div>
  49. </div>
  50. <h2 class="subsection-title">Methods</h2>
  51. <h3 class="name name-method" id="getCache" translate="no">.<a href="#getCache">getCache</a><span class="signature">( property : <span class="param-type">string</span>, type : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="MaterialReferenceNode.html">MaterialReferenceNode</a></span> </h3>
  52. <div class="method">
  53. <div class="description">
  54. <p>Returns a cached reference node for the given property and type.</p>
  55. </div>
  56. <table class="params">
  57. <tbody>
  58. <tr>
  59. <td class="name">
  60. <strong>property</strong>
  61. </td>
  62. <td class="description last">
  63. <p>The name of the material property.</p>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td class="name">
  68. <strong>type</strong>
  69. </td>
  70. <td class="description last">
  71. <p>The uniform type of the property.</p>
  72. </td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. <dl class="details">
  77. <dt class="tag-returns"><strong>Returns:</strong> A material reference node representing the property access.</dt>
  78. </dl>
  79. </div>
  80. <h3 class="name name-method" id="getColor" translate="no">.<a href="#getColor">getColor</a><span class="signature">( property : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="MaterialReferenceNode.html">MaterialReferenceNode</a>.&lt;color></span> </h3>
  81. <div class="method">
  82. <div class="description">
  83. <p>Returns a color-typed material reference node for the given property name.</p>
  84. </div>
  85. <table class="params">
  86. <tbody>
  87. <tr>
  88. <td class="name">
  89. <strong>property</strong>
  90. </td>
  91. <td class="description last">
  92. <p>The name of the material property.</p>
  93. </td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. <dl class="details">
  98. <dt class="tag-returns"><strong>Returns:</strong> A material reference node representing the property access.</dt>
  99. </dl>
  100. </div>
  101. <h3 class="name name-method" id="getFloat" translate="no">.<a href="#getFloat">getFloat</a><span class="signature">( property : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="MaterialReferenceNode.html">MaterialReferenceNode</a>.&lt;float></span> </h3>
  102. <div class="method">
  103. <div class="description">
  104. <p>Returns a float-typed material reference node for the given property name.</p>
  105. </div>
  106. <table class="params">
  107. <tbody>
  108. <tr>
  109. <td class="name">
  110. <strong>property</strong>
  111. </td>
  112. <td class="description last">
  113. <p>The name of the material property.</p>
  114. </td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. <dl class="details">
  119. <dt class="tag-returns"><strong>Returns:</strong> A material reference node representing the property access.</dt>
  120. </dl>
  121. </div>
  122. <h3 class="name name-method" id="getTexture" translate="no">.<a href="#getTexture">getTexture</a><span class="signature">( property : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="MaterialReferenceNode.html">MaterialReferenceNode</a></span> </h3>
  123. <div class="method">
  124. <div class="description">
  125. <p>Returns a texture-typed material reference node for the given property name.</p>
  126. </div>
  127. <table class="params">
  128. <tbody>
  129. <tr>
  130. <td class="name">
  131. <strong>property</strong>
  132. </td>
  133. <td class="description last">
  134. <p>The name of the material property.</p>
  135. </td>
  136. </tr>
  137. </tbody>
  138. </table>
  139. <dl class="details">
  140. <dt class="tag-returns"><strong>Returns:</strong> A material reference node representing the property access.</dt>
  141. </dl>
  142. </div>
  143. <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="Node.html">Node</a></span> </h3>
  144. <div class="method">
  145. <div class="description">
  146. <p>The node setup is done depending on the selected scope. Multiple material properties
  147. might be grouped into a single node composition if they logically belong together.</p>
  148. </div>
  149. <table class="params">
  150. <tbody>
  151. <tr>
  152. <td class="name">
  153. <strong>builder</strong>
  154. </td>
  155. <td class="description last">
  156. <p>The current node builder.</p>
  157. </td>
  158. </tr>
  159. </tbody>
  160. </table>
  161. <dl class="details">
  162. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Node.html#setup">Node#setup</a></dt>
  163. </dl>
  164. <dl class="details">
  165. <dt class="tag-returns"><strong>Returns:</strong> The node representing the selected scope.</dt>
  166. </dl>
  167. </div>
  168. <h2 class="subsection-title">Source</h2>
  169. <p>
  170. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/accessors/MaterialNode.js" translate="no" target="_blank" rel="noopener">src/nodes/accessors/MaterialNode.js</a>
  171. </p>
  172. </article>
  173. </section>
  174. <script src="../scripts/linenumber.js"></script>
  175. <script src="../scripts/page.js"></script>
  176. </body>
  177. </html>
粤ICP备19079148号