MeshLambertMaterial.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshLambertMaterial - 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">MeshLambertMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A material for non-shiny surfaces, without specular highlights.</p>
  17. <p>The material uses a non-physically based <a href="https://en.wikipedia.org/wiki/Lambertian_reflectance" target="_blank" rel="noopener">Lambertian</a>
  18. model for calculating reflectance. This can simulate some surfaces (such
  19. as untreated wood or stone) well, but cannot simulate shiny surfaces with
  20. specular highlights (such as varnished wood). <code>MeshLambertMaterial</code> uses per-fragment
  21. shading.</p>
  22. <p>Due to the simplicity of the reflectance and illumination models,
  23. performance will be greater when using this material over the
  24. <a href="MeshPhongMaterial.html">MeshPhongMaterial</a>, <a href="MeshStandardMaterial.html">MeshStandardMaterial</a> or
  25. <a href="MeshPhysicalMaterial.html">MeshPhysicalMaterial</a>, at the cost of some graphical accuracy.</p></div>
  26. <iframe id="viewer" src="../scenes/material-browser.html#MeshLambertMaterial"></iframe>
  27. </header>
  28. <article>
  29. <div class="container-overview">
  30. <h2>Constructor</h2>
  31. <h3 class="name name-method" id="MeshLambertMaterial" translate="no">new <a href="#MeshLambertMaterial">MeshLambertMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  32. <div class="method">
  33. <div class="description">
  34. <p>Constructs a new mesh lambert material.</p>
  35. </div>
  36. <table class="params">
  37. <tbody>
  38. <tr>
  39. <td class="name">
  40. <strong>parameters</strong>
  41. </td>
  42. <td class="description last">
  43. <p>An object with one or more properties
  44. defining the material's appearance. Any property of the material
  45. (including any property from inherited materials) can be passed
  46. in here. Color values can be passed any type of value accepted
  47. by <a href="Color.html#set">Color#set</a>.</p>
  48. </td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <h3 class="name" id="alphaMap" translate="no">.<a href="#alphaMap">alphaMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  57. <div class="description">
  58. <p>The alpha map is a grayscale texture that controls the opacity across the
  59. surface (black: fully transparent; white: fully opaque).</p>
  60. <p>Only the color of the texture is used, ignoring the alpha channel if one
  61. exists. For RGB and RGBA textures, the renderer will use the green channel
  62. when sampling this texture due to the extra bit of precision provided for
  63. green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
  64. luminance/alpha textures will also still work as expected.</p>
  65. <p>Default is <code>null</code>.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="aoMap" translate="no">.<a href="#aoMap">aoMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  70. <div class="description">
  71. <p>The red channel of this texture is used as the ambient occlusion map.
  72. Requires a second set of UVs.</p>
  73. <p>Default is <code>null</code>.</p>
  74. </div>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="aoMapIntensity" translate="no">.<a href="#aoMapIntensity">aoMapIntensity</a><span class="type-signature"> : number</span> </h3>
  78. <div class="description">
  79. <p>Intensity of the ambient occlusion effect. Range is <code>[0,1]</code>, where <code>0</code>
  80. disables ambient occlusion. Where intensity is <code>1</code> and the AO map's
  81. red channel is also <code>1</code>, ambient light is fully occluded on a surface.</p>
  82. <p>Default is <code>1</code>.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="bumpMap" translate="no">.<a href="#bumpMap">bumpMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  87. <div class="description">
  88. <p>The texture to create a bump map. The black and white values map to the
  89. perceived depth in relation to the lights. Bump doesn't actually affect
  90. the geometry of the object, only the lighting. If a normal map is defined
  91. this will be ignored.</p>
  92. <p>Default is <code>null</code>.</p>
  93. </div>
  94. </div>
  95. <div class="member">
  96. <h3 class="name" id="bumpScale" translate="no">.<a href="#bumpScale">bumpScale</a><span class="type-signature"> : number</span> </h3>
  97. <div class="description">
  98. <p>How much the bump map affects the material. Typical range is <code>[0,1]</code>.</p>
  99. <p>Default is <code>1</code>.</p>
  100. </div>
  101. </div>
  102. <div class="member">
  103. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  104. <div class="description">
  105. <p>Color of the material.</p>
  106. <p>Default is <code>(1,1,1)</code>.</p>
  107. </div>
  108. </div>
  109. <div class="member">
  110. <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>
  111. <div class="description">
  112. <p>How to combine the result of the surface's color with the environment map, if any.</p>
  113. <p>When set to <code>MixOperation</code>, the <a href="MeshBasicMaterial.html#reflectivity">MeshBasicMaterial#reflectivity</a> is used to
  114. blend between the two colors.</p>
  115. <p>Default is <code>MultiplyOperation</code>.</p>
  116. </div>
  117. </div>
  118. <div class="member">
  119. <h3 class="name" id="displacementBias" translate="no">.<a href="#displacementBias">displacementBias</a><span class="type-signature"> : number</span> </h3>
  120. <div class="description">
  121. <p>The offset of the displacement map's values on the mesh's vertices.
  122. The bias is added to the scaled sample of the displacement map.
  123. Without a displacement map set, this value is not applied.</p>
  124. <p>Default is <code>0</code>.</p>
  125. </div>
  126. </div>
  127. <div class="member">
  128. <h3 class="name" id="displacementMap" translate="no">.<a href="#displacementMap">displacementMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  129. <div class="description">
  130. <p>The displacement map affects the position of the mesh's vertices. Unlike
  131. other maps which only affect the light and shade of the material the
  132. displaced vertices can cast shadows, block other objects, and otherwise
  133. act as real geometry. The displacement texture is an image where the value
  134. of each pixel (white being the highest) is mapped against, and
  135. repositions, the vertices of the mesh.</p>
  136. <p>Default is <code>null</code>.</p>
  137. </div>
  138. </div>
  139. <div class="member">
  140. <h3 class="name" id="displacementScale" translate="no">.<a href="#displacementScale">displacementScale</a><span class="type-signature"> : number</span> </h3>
  141. <div class="description">
  142. <p>How much the displacement map affects the mesh (where black is no
  143. displacement, and white is maximum displacement). Without a displacement
  144. map set, this value is not applied.</p>
  145. <p>Default is <code>0</code>.</p>
  146. </div>
  147. </div>
  148. <div class="member">
  149. <h3 class="name" id="emissive" translate="no">.<a href="#emissive">emissive</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  150. <div class="description">
  151. <p>Emissive (light) color of the material, essentially a solid color
  152. unaffected by other lighting.</p>
  153. <p>Default is <code>(0,0,0)</code>.</p>
  154. </div>
  155. </div>
  156. <div class="member">
  157. <h3 class="name" id="emissiveIntensity" translate="no">.<a href="#emissiveIntensity">emissiveIntensity</a><span class="type-signature"> : number</span> </h3>
  158. <div class="description">
  159. <p>Intensity of the emissive light. Modulates the emissive color.</p>
  160. <p>Default is <code>1</code>.</p>
  161. </div>
  162. </div>
  163. <div class="member">
  164. <h3 class="name" id="emissiveMap" translate="no">.<a href="#emissiveMap">emissiveMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  165. <div class="description">
  166. <p>Set emissive (glow) map. The emissive map color is modulated by the
  167. emissive color and the emissive intensity. If you have an emissive map,
  168. be sure to set the emissive color to something other than black.</p>
  169. <p>Default is <code>null</code>.</p>
  170. </div>
  171. </div>
  172. <div class="member">
  173. <h3 class="name" id="envMap" translate="no">.<a href="#envMap">envMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  174. <div class="description">
  175. <p>The environment map.</p>
  176. <p>Default is <code>null</code>.</p>
  177. </div>
  178. </div>
  179. <div class="member">
  180. <h3 class="name" id="envMapRotation" translate="no">.<a href="#envMapRotation">envMapRotation</a><span class="type-signature"> : <a href="Euler.html">Euler</a></span> </h3>
  181. <div class="description">
  182. <p>The rotation of the environment map in radians.</p>
  183. <p>Default is <code>(0,0,0)</code>.</p>
  184. </div>
  185. </div>
  186. <div class="member">
  187. <h3 class="name" id="flatShading" translate="no">.<a href="#flatShading">flatShading</a><span class="type-signature"> : boolean</span> </h3>
  188. <div class="description">
  189. <p>Whether the material is rendered with flat shading or not.</p>
  190. <p>Default is <code>false</code>.</p>
  191. </div>
  192. </div>
  193. <div class="member">
  194. <h3 class="name" id="fog" translate="no">.<a href="#fog">fog</a><span class="type-signature"> : boolean</span> </h3>
  195. <div class="description">
  196. <p>Whether the material is affected by fog or not.</p>
  197. <p>Default is <code>true</code>.</p>
  198. </div>
  199. </div>
  200. <div class="member">
  201. <h3 class="name" id="isMeshLambertMaterial" translate="no">.<a href="#isMeshLambertMaterial">isMeshLambertMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  202. <div class="description">
  203. <p>This flag can be used for type testing.</p>
  204. <p>Default is <code>true</code>.</p>
  205. </div>
  206. </div>
  207. <div class="member">
  208. <h3 class="name" id="lightMap" translate="no">.<a href="#lightMap">lightMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  209. <div class="description">
  210. <p>The light map. Requires a second set of UVs.</p>
  211. <p>Default is <code>null</code>.</p>
  212. </div>
  213. </div>
  214. <div class="member">
  215. <h3 class="name" id="lightMapIntensity" translate="no">.<a href="#lightMapIntensity">lightMapIntensity</a><span class="type-signature"> : number</span> </h3>
  216. <div class="description">
  217. <p>Intensity of the baked light.</p>
  218. <p>Default is <code>1</code>.</p>
  219. </div>
  220. </div>
  221. <div class="member">
  222. <h3 class="name" id="map" translate="no">.<a href="#map">map</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  223. <div class="description">
  224. <p>The color map. May optionally include an alpha channel, typically combined
  225. with <a href="Material.html#transparent">Material#transparent</a> or <a href="Material.html#alphaTest">Material#alphaTest</a>. The texture map
  226. color is modulated by the diffuse <code>color</code>.</p>
  227. <p>Default is <code>null</code>.</p>
  228. </div>
  229. </div>
  230. <div class="member">
  231. <h3 class="name" id="normalMap" translate="no">.<a href="#normalMap">normalMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  232. <div class="description">
  233. <p>The texture to create a normal map. The RGB values affect the surface
  234. normal for each pixel fragment and change the way the color is lit. Normal
  235. maps do not change the actual shape of the surface, only the lighting. In
  236. case the material has a normal map authored using the left handed
  237. convention, the <code>y</code> component of <code>normalScale</code> should be negated to compensate
  238. for the different handedness.</p>
  239. <p>Default is <code>null</code>.</p>
  240. </div>
  241. </div>
  242. <div class="member">
  243. <h3 class="name" id="normalMapType" translate="no">.<a href="#normalMapType">normalMapType</a><span class="type-signature"> : <a href="global.html#TangentSpaceNormalMap">TangentSpaceNormalMap</a> | <a href="global.html#ObjectSpaceNormalMap">ObjectSpaceNormalMap</a></span> </h3>
  244. <div class="description">
  245. <p>The type of normal map.</p>
  246. <p>Default is <code>TangentSpaceNormalMap</code>.</p>
  247. </div>
  248. </div>
  249. <div class="member">
  250. <h3 class="name" id="normalScale" translate="no">.<a href="#normalScale">normalScale</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  251. <div class="description">
  252. <p>How much the normal map affects the material. Typical value range is <code>[0,1]</code>.</p>
  253. <p>Default is <code>(1,1)</code>.</p>
  254. </div>
  255. </div>
  256. <div class="member">
  257. <h3 class="name" id="reflectivity" translate="no">.<a href="#reflectivity">reflectivity</a><span class="type-signature"> : number</span> </h3>
  258. <div class="description">
  259. <p>How much the environment map affects the surface.
  260. The valid range is between <code>0</code> (no reflections) and <code>1</code> (full reflections).</p>
  261. <p>Default is <code>1</code>.</p>
  262. </div>
  263. </div>
  264. <div class="member">
  265. <h3 class="name" id="refractionRatio" translate="no">.<a href="#refractionRatio">refractionRatio</a><span class="type-signature"> : number</span> </h3>
  266. <div class="description">
  267. <p>The index of refraction (IOR) of air (approximately 1) divided by the
  268. index of refraction of the material. It is used with environment mapping
  269. modes <a href="global.html#CubeRefractionMapping">CubeRefractionMapping</a> and <a href="global.html#EquirectangularRefractionMapping">EquirectangularRefractionMapping</a>.
  270. The refraction ratio should not exceed <code>1</code>.</p>
  271. <p>Default is <code>0.98</code>.</p>
  272. </div>
  273. </div>
  274. <div class="member">
  275. <h3 class="name" id="specularMap" translate="no">.<a href="#specularMap">specularMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  276. <div class="description">
  277. <p>Specular map used by the material.</p>
  278. <p>Default is <code>null</code>.</p>
  279. </div>
  280. </div>
  281. <div class="member">
  282. <h3 class="name" id="wireframe" translate="no">.<a href="#wireframe">wireframe</a><span class="type-signature"> : boolean</span> </h3>
  283. <div class="description">
  284. <p>Renders the geometry as a wireframe.</p>
  285. <p>Default is <code>false</code>.</p>
  286. </div>
  287. </div>
  288. <div class="member">
  289. <h3 class="name" id="wireframeLinecap" translate="no">.<a href="#wireframeLinecap">wireframeLinecap</a><span class="type-signature"> : 'round' | 'bevel' | 'miter'</span> </h3>
  290. <div class="description">
  291. <p>Defines appearance of wireframe ends.</p>
  292. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  293. <p>Default is <code>'round'</code>.</p>
  294. </div>
  295. </div>
  296. <div class="member">
  297. <h3 class="name" id="wireframeLinejoin" translate="no">.<a href="#wireframeLinejoin">wireframeLinejoin</a><span class="type-signature"> : 'round' | 'bevel' | 'miter'</span> </h3>
  298. <div class="description">
  299. <p>Defines appearance of wireframe joints.</p>
  300. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  301. <p>Default is <code>'round'</code>.</p>
  302. </div>
  303. </div>
  304. <div class="member">
  305. <h3 class="name" id="wireframeLinewidth" translate="no">.<a href="#wireframeLinewidth">wireframeLinewidth</a><span class="type-signature"> : number</span> </h3>
  306. <div class="description">
  307. <p>Controls the thickness of the wireframe.</p>
  308. <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
  309. <p>Default is <code>1</code>.</p>
  310. </div>
  311. </div>
  312. <h2 class="subsection-title">Source</h2>
  313. <p>
  314. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshLambertMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshLambertMaterial.js</a>
  315. </p>
  316. </article>
  317. </section>
  318. <script src="../scripts/linenumber.js"></script>
  319. <script src="../scripts/page.js"></script>
  320. </body>
  321. </html>
粤ICP备19079148号