MeshLambertMaterial.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Material] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. A material for non-shiny surfaces, without specular highlights.<br /><br />
  14. The material uses a non-physically based
  15. [link:https://en.wikipedia.org/wiki/Lambertian_reflectance Lambertian]
  16. model for calculating reflectance. This can simulate some surfaces (such
  17. as untreated wood or stone) well, but cannot simulate shiny surfaces with
  18. specular highlights (such as varnished wood). [name] uses per-fragment
  19. shading.<br /><br />
  20. Due to the simplicity of the reflectance and illumination models,
  21. performance will be greater when using this material over the
  22. [page:MeshPhongMaterial], [page:MeshStandardMaterial] or
  23. [page:MeshPhysicalMaterial], at the cost of some graphical accuracy.
  24. </p>
  25. <iframe
  26. id="scene"
  27. src="scenes/material-browser.html#MeshLambertMaterial"
  28. ></iframe>
  29. <script>
  30. // iOS iframe auto-resize workaround
  31. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  32. const scene = document.getElementById( 'scene' );
  33. scene.style.width = getComputedStyle( scene ).width;
  34. scene.style.height = getComputedStyle( scene ).height;
  35. scene.setAttribute( 'scrolling', 'no' );
  36. }
  37. </script>
  38. <h2>Constructor</h2>
  39. <h3>[name]( [param:Object parameters] )</h3>
  40. <p>
  41. [page:Object parameters] - (optional) an object with one or more
  42. properties defining the material's appearance. Any property of the
  43. material (including any property inherited from [page:Material]) can be
  44. passed in here.<br /><br />
  45. The exception is the property [page:Hexadecimal color], which can be
  46. passed in as a hexadecimal string and is `0xffffff` (white) by default.
  47. [page:Color.set]( color ) is called internally.
  48. </p>
  49. <h2>Properties</h2>
  50. <p>See the base [page:Material] class for common properties.</p>
  51. <h3>[property:Texture alphaMap]</h3>
  52. <p>
  53. The alpha map is a grayscale texture that controls the opacity across the
  54. surface (black: fully transparent; white: fully opaque). Default is
  55. null.<br /><br />
  56. Only the color of the texture is used, ignoring the alpha channel if one
  57. exists. For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer
  58. will use the green channel when sampling this texture due to the extra bit
  59. of precision provided for green in DXT-compressed and uncompressed RGB 565
  60. formats. Luminance-only and luminance/alpha textures will also still work
  61. as expected.
  62. </p>
  63. <h3>[property:Texture aoMap]</h3>
  64. <p>
  65. The red channel of this texture is used as the ambient occlusion map.
  66. Default is null. The aoMap requires a second set of UVs.
  67. </p>
  68. <h3>[property:Float aoMapIntensity]</h3>
  69. <p>
  70. Intensity of the ambient occlusion effect. Range is 0-1, where `0`
  71. disables ambient occlusion. Where intensity is `1` and the [page:.aoMap]
  72. red channel is also `1`, ambient light is fully occluded on a surface.
  73. Default is `1`.
  74. </p>
  75. <h3>[property:Texture bumpMap]</h3>
  76. <p>
  77. The texture to create a bump map. The black and white values map to the
  78. perceived depth in relation to the lights. Bump doesn't actually affect
  79. the geometry of the object, only the lighting. If a normal map is defined
  80. this will be ignored.
  81. </p>
  82. <h3>[property:Float bumpScale]</h3>
  83. <p>
  84. How much the bump map affects the material. Typical ranges are 0-1.
  85. Default is 1.
  86. </p>
  87. <h3>[property:Color color]</h3>
  88. <p>[page:Color] of the material, by default set to white (0xffffff).</p>
  89. <h3>[property:Integer combine]</h3>
  90. <p>
  91. How to combine the result of the surface's color with the environment map,
  92. if any.<br /><br />
  93. Options are [page:Materials THREE.MultiplyOperation] (default),
  94. [page:Materials THREE.MixOperation], [page:Materials THREE.AddOperation].
  95. If mix is chosen, the [page:.reflectivity] is used to blend between the
  96. two colors.
  97. </p>
  98. <h3>[property:Texture displacementMap]</h3>
  99. <p>
  100. The displacement map affects the position of the mesh's vertices. Unlike
  101. other maps which only affect the light and shade of the material the
  102. displaced vertices can cast shadows, block other objects, and otherwise
  103. act as real geometry. The displacement texture is an image where the value
  104. of each pixel (white being the highest) is mapped against, and
  105. repositions, the vertices of the mesh.
  106. </p>
  107. <h3>[property:Float displacementScale]</h3>
  108. <p>
  109. How much the displacement map affects the mesh (where black is no
  110. displacement, and white is maximum displacement). Without a displacement
  111. map set, this value is not applied. Default is `1`.
  112. </p>
  113. <h3>[property:Float displacementBias]</h3>
  114. <p>
  115. The offset of the displacement map's values on the mesh's vertices.
  116. Without a displacement map set, this value is not applied. Default is `0`.
  117. </p>
  118. <h3>[property:Color emissive]</h3>
  119. <p>
  120. Emissive (light) color of the material, essentially a solid color
  121. unaffected by other lighting. Default is black.
  122. </p>
  123. <h3>[property:Texture emissiveMap]</h3>
  124. <p>
  125. Set emissive (glow) map. Default is null. The emissive map color is
  126. modulated by the emissive color and the emissive intensity. If you have an
  127. emissive map, be sure to set the emissive color to something other than
  128. black.
  129. </p>
  130. <h3>[property:Float emissiveIntensity]</h3>
  131. <p>
  132. Intensity of the emissive light. Modulates the emissive color. Default is
  133. 1.
  134. </p>
  135. <h3>[property:Texture envMap]</h3>
  136. <p>The environment map. Default is null.</p>
  137. <h3>[property:Euler envMapRotation]</h3>
  138. <p>
  139. The rotation of the environment map in radians. Default is `(0,0,0)`.
  140. </p>
  141. <h3>[property:Boolean flatShading]</h3>
  142. <p>
  143. Define whether the material is rendered with flat shading. Default is
  144. false.
  145. </p>
  146. <h3>[property:Boolean fog]</h3>
  147. <p>Whether the material is affected by fog. Default is `true`.</p>
  148. <h3>[property:Texture lightMap]</h3>
  149. <p>
  150. The light map. Default is null. The lightMap requires a second set of UVs.
  151. </p>
  152. <h3>[property:Float lightMapIntensity]</h3>
  153. <p>Intensity of the baked light. Default is `1`.</p>
  154. <h3>[property:Texture map]</h3>
  155. <p>
  156. The color map. May optionally include an alpha channel, typically combined
  157. with [page:Material.transparent .transparent] or [page:Material.alphaTest .alphaTest].
  158. Default is null.
  159. </p>
  160. <h3>[property:Texture normalMap]</h3>
  161. <p>
  162. The texture to create a normal map. The RGB values affect the surface
  163. normal for each pixel fragment and change the way the color is lit. Normal
  164. maps do not change the actual shape of the surface, only the lighting. In
  165. case the material has a normal map authored using the left handed
  166. convention, the y component of normalScale should be negated to compensate
  167. for the different handedness.
  168. </p>
  169. <h3>[property:Integer normalMapType]</h3>
  170. <p>
  171. The type of normal map.<br /><br />
  172. Options are [page:constant THREE.TangentSpaceNormalMap] (default), and
  173. [page:constant THREE.ObjectSpaceNormalMap].
  174. </p>
  175. <h3>[property:Vector2 normalScale]</h3>
  176. <p>
  177. How much the normal map affects the material. Typical ranges are 0-1.
  178. Default is a [page:Vector2] set to (1,1).
  179. </p>
  180. <h3>[property:Float reflectivity]</h3>
  181. <p>
  182. How much the environment map affects the surface; also see
  183. [page:.combine].
  184. </p>
  185. <h3>[property:Float refractionRatio]</h3>
  186. <p>
  187. The index of refraction (IOR) of air (approximately 1) divided by the
  188. index of refraction of the material. It is used with environment mapping
  189. modes [page:Textures THREE.CubeRefractionMapping] and [page:Textures THREE.EquirectangularRefractionMapping].
  190. The refraction ratio should not
  191. exceed `1`. Default is `0.98`.
  192. </p>
  193. <h3>[property:Texture specularMap]</h3>
  194. <p>Specular map used by the material. Default is null.</p>
  195. <h3>[property:Boolean wireframe]</h3>
  196. <p>
  197. Render geometry as wireframe. Default is `false` (i.e. render as flat
  198. polygons).
  199. </p>
  200. <h3>[property:String wireframeLinecap]</h3>
  201. <p>
  202. Define appearance of line ends. Possible values are "butt", "round" and
  203. "square". Default is 'round'.<br /><br />
  204. This corresponds to the
  205. [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap]
  206. property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
  207. </p>
  208. <h3>[property:String wireframeLinejoin]</h3>
  209. <p>
  210. Define appearance of line joints. Possible values are "round", "bevel" and
  211. "miter". Default is 'round'.<br /><br />
  212. This corresponds to the
  213. [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin]
  214. property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
  215. </p>
  216. <h3>[property:Float wireframeLinewidth]</h3>
  217. <p>
  218. Controls wireframe thickness. Default is `1`.<br /><br />
  219. Due to limitations of the
  220. [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]
  221. with the [page:WebGLRenderer WebGL] renderer on most
  222. platforms linewidth will always be `1` regardless of the set value.
  223. </p>
  224. <h2>Methods</h2>
  225. <p>See the base [page:Material] class for common methods.</p>
  226. <h2>Source</h2>
  227. <p>
  228. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  229. </p>
  230. </body>
  231. </html>