MeshBasicMaterial.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshBasicMaterial - 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> → </p>
  13. <h1 translate="no">MeshBasicMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A material for drawing geometries in a simple shaded (flat or wireframe) way.</p>
  17. <p>This material is not affected by lights.</p></div>
  18. <iframe id="viewer" src="../scenes/material-browser.html#MeshBasicMaterial"></iframe>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="MeshBasicMaterial" translate="no">new <a href="#MeshBasicMaterial">MeshBasicMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new mesh basic material.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name">
  32. <strong translate="no">parameters</strong>
  33. </td>
  34. <td class="description last">
  35. <p>An object with one or more properties
  36. defining the material's appearance. Any property of the material
  37. (including any property from inherited materials) can be passed
  38. in here. Color values can be passed any type of value accepted
  39. by <a href="Color.html#set">Color#set</a>.</p>
  40. </td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. <h2 class="subsection-title">Properties</h2>
  47. <div class="member">
  48. <h3 class="name" id="alphaMap" translate="no">.<a href="#alphaMap">alphaMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  49. <div class="description">
  50. <p>The alpha map is a grayscale texture that controls the opacity across the
  51. surface (black: fully transparent; white: fully opaque).</p>
  52. <p>Only the color of the texture is used, ignoring the alpha channel if one
  53. exists. For RGB and RGBA textures, the renderer will use the green channel
  54. when sampling this texture due to the extra bit of precision provided for
  55. green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
  56. luminance/alpha textures will also still work as expected.</p>
  57. <p><code>alphaMap</code> represents non-color data. Any texture assigned must have
  58. <code>texture.colorSpace = NoColorSpace</code> (default).</p>
  59. <p>Default is <code>null</code>.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="aoMap" translate="no">.<a href="#aoMap">aoMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  64. <div class="description">
  65. <p>The red channel of this texture is used as the ambient occlusion map.
  66. Requires a second set of UVs.</p>
  67. <p><code>aoMap</code> represents non-color data. Any texture assigned must have
  68. <code>texture.colorSpace = NoColorSpace</code> (default).</p>
  69. <p>Default is <code>null</code>.</p>
  70. </div>
  71. </div>
  72. <div class="member">
  73. <h3 class="name" id="aoMapIntensity" translate="no">.<a href="#aoMapIntensity">aoMapIntensity</a><span class="type-signature"> : number</span> </h3>
  74. <div class="description">
  75. <p>Intensity of the ambient occlusion effect. Range is <code>[0,1]</code>, where <code>0</code>
  76. disables ambient occlusion. Where intensity is <code>1</code> and the AO map's
  77. red channel is also <code>1</code>, ambient light is fully occluded on a surface.</p>
  78. <p>Default is <code>1</code>.</p>
  79. </div>
  80. </div>
  81. <div class="member">
  82. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  83. <div class="description">
  84. <p>Color of the material.</p>
  85. <p>Default is <code>(1,1,1)</code>.</p>
  86. </div>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="combine" translate="no">.<a href="#combine">combine</a><span class="type-signature"> : <a href="global.html#MultiplyOperation">MultiplyOperation</a> | <a href="global.html#MixOperation">MixOperation</a> | <a href="global.html#AddOperation">AddOperation</a></span> </h3>
  90. <div class="description">
  91. <p>How to combine the result of the surface's color with the environment map, if any.</p>
  92. <p>When set to <code>MixOperation</code>, the <a href="MeshBasicMaterial.html#reflectivity">MeshBasicMaterial#reflectivity</a> is used to
  93. blend between the two colors.</p>
  94. <p>Default is <code>MultiplyOperation</code>.</p>
  95. </div>
  96. </div>
  97. <div class="member">
  98. <h3 class="name" id="envMap" translate="no">.<a href="#envMap">envMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  99. <div class="description">
  100. <p>The environment map.</p>
  101. <p><code>envMap</code> represents luminance data, and the texture must be assigned
  102. a <a href="Texture.html#colorSpace">Texture#colorSpace</a>. Most <code>envMap</code> textures set
  103. <code>texture.colorSpace = LinearSRGBColorSpace</code> and use float-type formats
  104. such as <code>.exr</code> or <code>.hdr</code>.</p>
  105. <p>Default is <code>null</code>.</p>
  106. </div>
  107. </div>
  108. <div class="member">
  109. <h3 class="name" id="envMapRotation" translate="no">.<a href="#envMapRotation">envMapRotation</a><span class="type-signature"> : <a href="Euler.html">Euler</a></span> </h3>
  110. <div class="description">
  111. <p>The rotation of the environment map in radians.</p>
  112. <p>Default is <code>(0,0,0)</code>.</p>
  113. </div>
  114. </div>
  115. <div class="member">
  116. <h3 class="name" id="fog" translate="no">.<a href="#fog">fog</a><span class="type-signature"> : boolean</span> </h3>
  117. <div class="description">
  118. <p>Whether the material is affected by fog or not.</p>
  119. <p>Default is <code>true</code>.</p>
  120. </div>
  121. </div>
  122. <div class="member">
  123. <h3 class="name" id="isMeshBasicMaterial" translate="no">.<a href="#isMeshBasicMaterial">isMeshBasicMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  124. <div class="description">
  125. <p>This flag can be used for type testing.</p>
  126. <p>Default is <code>true</code>.</p>
  127. </div>
  128. </div>
  129. <div class="member">
  130. <h3 class="name" id="lightMap" translate="no">.<a href="#lightMap">lightMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  131. <div class="description">
  132. <p>The light map. Requires a second set of UVs.</p>
  133. <p><code>lightMap</code> represents pre-baked illuminance data, and the texture must be assigned
  134. a <a href="Texture.html#colorSpace">Texture#colorSpace</a>. Most <code>lightMap</code> textures set
  135. <code>texture.colorSpace = LinearSRGBColorSpace</code> and use float-type formats
  136. such as <code>.exr</code> or <code>.hdr</code>.</p>
  137. <p>Default is <code>null</code>.</p>
  138. </div>
  139. </div>
  140. <div class="member">
  141. <h3 class="name" id="lightMapIntensity" translate="no">.<a href="#lightMapIntensity">lightMapIntensity</a><span class="type-signature"> : number</span> </h3>
  142. <div class="description">
  143. <p>Intensity of the baked light.</p>
  144. <p>Default is <code>1</code>.</p>
  145. </div>
  146. </div>
  147. <div class="member">
  148. <h3 class="name" id="map" translate="no">.<a href="#map">map</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  149. <div class="description">
  150. <p>The color map. May optionally include an alpha channel, typically combined
  151. with <a href="Material.html#transparent">Material#transparent</a> or <a href="Material.html#alphaTest">Material#alphaTest</a>. The texture map
  152. color is modulated by the diffuse <code>color</code>.</p>
  153. <p><code>map</code> represents color data, and the texture must be assigned a
  154. <a href="Texture.html#colorSpace">Texture#colorSpace</a>. Most <code>map</code> textures set
  155. <code>texture.colorSpace = SRGBColorSpace</code>.</p>
  156. <p>Default is <code>null</code>.</p>
  157. </div>
  158. </div>
  159. <div class="member">
  160. <h3 class="name" id="reflectivity" translate="no">.<a href="#reflectivity">reflectivity</a><span class="type-signature"> : number</span> </h3>
  161. <div class="description">
  162. <p>How much the environment map affects the surface.
  163. The valid range is between <code>0</code> (no reflections) and <code>1</code> (full reflections).</p>
  164. <p>Default is <code>1</code>.</p>
  165. </div>
  166. </div>
  167. <div class="member">
  168. <h3 class="name" id="refractionRatio" translate="no">.<a href="#refractionRatio">refractionRatio</a><span class="type-signature"> : number</span> </h3>
  169. <div class="description">
  170. <p>The index of refraction (IOR) of air (approximately 1) divided by the
  171. index of refraction of the material. It is used with environment mapping
  172. modes <a href="global.html#CubeRefractionMapping">CubeRefractionMapping</a> and <a href="global.html#EquirectangularRefractionMapping">EquirectangularRefractionMapping</a>.
  173. The refraction ratio should not exceed <code>1</code>.</p>
  174. <p>Default is <code>0.98</code>.</p>
  175. </div>
  176. </div>
  177. <div class="member">
  178. <h3 class="name" id="specularMap" translate="no">.<a href="#specularMap">specularMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  179. <div class="description">
  180. <p>Specular map used by the material.</p>
  181. <p><code>specularMap</code> represents color data, and the texture must be assigned a
  182. <a href="Texture.html#colorSpace">Texture#colorSpace</a>. Most <code>specularMap</code> textures set
  183. <code>texture.colorSpace = SRGBColorSpace</code>.</p>
  184. <p>Default is <code>null</code>.</p>
  185. </div>
  186. </div>
  187. <div class="member">
  188. <h3 class="name" id="wireframe" translate="no">.<a href="#wireframe">wireframe</a><span class="type-signature"> : boolean</span> </h3>
  189. <div class="description">
  190. <p>Renders the geometry as a wireframe.</p>
  191. <p>Default is <code>false</code>.</p>
  192. </div>
  193. </div>
  194. <div class="member">
  195. <h3 class="name" id="wireframeLinecap" translate="no">.<a href="#wireframeLinecap">wireframeLinecap</a><span class="type-signature"> : 'round' | 'bevel' | 'miter'</span> </h3>
  196. <div class="description">
  197. <p>Defines appearance of wireframe ends.</p>
  198. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  199. <p>Default is <code>'round'</code>.</p>
  200. </div>
  201. </div>
  202. <div class="member">
  203. <h3 class="name" id="wireframeLinejoin" translate="no">.<a href="#wireframeLinejoin">wireframeLinejoin</a><span class="type-signature"> : 'round' | 'bevel' | 'miter'</span> </h3>
  204. <div class="description">
  205. <p>Defines appearance of wireframe joints.</p>
  206. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  207. <p>Default is <code>'round'</code>.</p>
  208. </div>
  209. </div>
  210. <div class="member">
  211. <h3 class="name" id="wireframeLinewidth" translate="no">.<a href="#wireframeLinewidth">wireframeLinewidth</a><span class="type-signature"> : number</span> </h3>
  212. <div class="description">
  213. <p>Controls the thickness of the wireframe.</p>
  214. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  215. <p>Default is <code>1</code>.</p>
  216. </div>
  217. </div>
  218. <h2 class="subsection-title">Source</h2>
  219. <p>
  220. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshBasicMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshBasicMaterial.js</a>
  221. </p>
  222. </article>
  223. </section>
  224. <script src="../scripts/linenumber.js"></script>
  225. <script src="../scripts/page.js"></script>
  226. </body>
  227. </html>
粤ICP备19079148号