1
0

MeshBasicNodeMaterial.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshBasicNodeMaterial - 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="Material.html">Material</a> → <a href="NodeMaterial.html">NodeMaterial</a> → </p>
  13. <h1 translate="no">MeshBasicNodeMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Node material version of <a href="MeshBasicMaterial.html">MeshBasicMaterial</a>.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="MeshBasicNodeMaterial" translate="no">new <a href="#MeshBasicNodeMaterial">MeshBasicNodeMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new mesh basic node material.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name">
  30. <strong>parameters</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The configuration parameter.</p>
  34. </td>
  35. </tr>
  36. </tbody>
  37. </table>
  38. </div>
  39. </div>
  40. <h2 class="subsection-title">Properties</h2>
  41. <div class="member">
  42. <h3 class="name" id="isMeshBasicNodeMaterial" translate="no">.<a href="#isMeshBasicNodeMaterial">isMeshBasicNodeMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  43. <div class="description">
  44. <p>This flag can be used for type testing.</p>
  45. <p>Default is <code>true</code>.</p>
  46. </div>
  47. </div>
  48. <div class="member">
  49. <h3 class="name" id="lights" translate="no">.<a href="#lights">lights</a><span class="type-signature"> : boolean</span> </h3>
  50. <div class="description">
  51. <p>Although the basic material is by definition unlit, we set
  52. this property to <code>true</code> since we use a lighting model to compute
  53. the outgoing light of the fragment shader.</p>
  54. <p>Default is <code>true</code>.</p>
  55. </div>
  56. <dl class="details">
  57. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeMaterial.html#lights">NodeMaterial#lights</a></dt>
  58. </dl>
  59. </div>
  60. <h2 class="subsection-title">Methods</h2>
  61. <h3 class="name name-method" id="setupEnvironment" translate="no">.<a href="#setupEnvironment">setupEnvironment</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : <a href="BasicEnvironmentNode.html">BasicEnvironmentNode</a>.&lt;vec3></span> </h3>
  62. <div class="method">
  63. <div class="description">
  64. <p>Overwritten since this type of material uses <a href="BasicEnvironmentNode.html">BasicEnvironmentNode</a>
  65. to implement the default environment mapping.</p>
  66. </div>
  67. <table class="params">
  68. <tbody>
  69. <tr>
  70. <td class="name">
  71. <strong>builder</strong>
  72. </td>
  73. <td class="description last">
  74. <p>The current node builder.</p>
  75. </td>
  76. </tr>
  77. </tbody>
  78. </table>
  79. <dl class="details">
  80. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeMaterial.html#setupEnvironment">NodeMaterial#setupEnvironment</a></dt>
  81. </dl>
  82. <dl class="details">
  83. <dt class="tag-returns"><strong>Returns:</strong> The environment node.</dt>
  84. </dl>
  85. </div>
  86. <h3 class="name name-method" id="setupLightMap" translate="no">.<a href="#setupLightMap">setupLightMap</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : <a href="BasicLightMapNode.html">BasicLightMapNode</a>.&lt;vec3></span> </h3>
  87. <div class="method">
  88. <div class="description">
  89. <p>This method must be overwritten since light maps are evaluated
  90. with a special scaling factor for basic materials.</p>
  91. </div>
  92. <table class="params">
  93. <tbody>
  94. <tr>
  95. <td class="name">
  96. <strong>builder</strong>
  97. </td>
  98. <td class="description last">
  99. <p>The current node builder.</p>
  100. </td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. <dl class="details">
  105. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeMaterial.html#setupLightMap">NodeMaterial#setupLightMap</a></dt>
  106. </dl>
  107. <dl class="details">
  108. <dt class="tag-returns"><strong>Returns:</strong> The light map node.</dt>
  109. </dl>
  110. </div>
  111. <h3 class="name name-method" id="setupLightingModel" translate="no">.<a href="#setupLightingModel">setupLightingModel</a><span class="signature">()</span><span class="type-signature"> : <a href="BasicLightingModel.html">BasicLightingModel</a></span> </h3>
  112. <div class="method">
  113. <div class="description">
  114. <p>Setups the lighting model.</p>
  115. </div>
  116. <dl class="details">
  117. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeMaterial.html#setupLightingModel">NodeMaterial#setupLightingModel</a></dt>
  118. </dl>
  119. <dl class="details">
  120. <dt class="tag-returns"><strong>Returns:</strong> The lighting model.</dt>
  121. </dl>
  122. </div>
  123. <h3 class="name name-method" id="setupNormal" translate="no">.<a href="#setupNormal">setupNormal</a><span class="signature">()</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec3></span> </h3>
  124. <div class="method">
  125. <div class="description">
  126. <p>Basic materials are not affected by normal and bump maps so we
  127. return by default <a href="TSL.html#normalViewGeometry">normalViewGeometry</a>.</p>
  128. </div>
  129. <dl class="details">
  130. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeMaterial.html#setupNormal">NodeMaterial#setupNormal</a></dt>
  131. </dl>
  132. <dl class="details">
  133. <dt class="tag-returns"><strong>Returns:</strong> The normal node.</dt>
  134. </dl>
  135. </div>
  136. <h3 class="name name-method" id="setupOutgoingLight" translate="no">.<a href="#setupOutgoingLight">setupOutgoingLight</a><span class="signature">()</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec3></span> </h3>
  137. <div class="method">
  138. <div class="description">
  139. <p>The material overwrites this method because <code>lights</code> is set to <code>true</code> but
  140. we still want to return the diffuse color as the outgoing light.</p>
  141. </div>
  142. <dl class="details">
  143. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="NodeMaterial.html#setupOutgoingLight">NodeMaterial#setupOutgoingLight</a></dt>
  144. </dl>
  145. <dl class="details">
  146. <dt class="tag-returns"><strong>Returns:</strong> The outgoing light node.</dt>
  147. </dl>
  148. </div>
  149. <h2 class="subsection-title">Source</h2>
  150. <p>
  151. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/nodes/MeshBasicNodeMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/nodes/MeshBasicNodeMaterial.js</a>
  152. </p>
  153. </article>
  154. </section>
  155. <script src="../scripts/linenumber.js"></script>
  156. <script src="../scripts/page.js"></script>
  157. </body>
  158. </html>
粤ICP备19079148号