MeshStandardMaterial.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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 standard physically based material, using Metallic-Roughness
  14. workflow.<br /><br />
  15. Physically based rendering (PBR) has recently become the standard in many
  16. 3D applications, such as
  17. [link:https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/ Unity],
  18. [link:https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/ Unreal] and
  19. [link:http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017 3D Studio Max].<br /><br />
  20. This approach differs from older approaches in that instead of using
  21. approximations for the way in which light interacts with a surface, a
  22. physically correct model is used. The idea is that, instead of tweaking
  23. materials to look good under specific lighting, a material can be created
  24. that will react 'correctly' under all lighting scenarios.<br /><br />
  25. In practice this gives a more accurate and realistic looking result than
  26. the [page:MeshLambertMaterial] or [page:MeshPhongMaterial], at the cost of
  27. being somewhat more computationally expensive. [name] uses per-fragment
  28. shading.<br /><br />
  29. Note that for best results you should always specify an [page:.envMap environment map]
  30. when using this material.<br /><br />
  31. For a non-technical introduction to the concept of PBR and how to set up a
  32. PBR material, check out these articles by the people at
  33. [link:https://www.marmoset.co marmoset]:
  34. </p>
  35. <ul>
  36. <li>
  37. [link:https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/ Basic Theory of Physically Based Rendering]
  38. </li>
  39. <li>
  40. [link:https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/ Physically Based Rendering and You Can Too]
  41. </li>
  42. </ul>
  43. <p>
  44. Technical details of the approach used in three.js (and most other PBR
  45. systems) can be found is this
  46. [link:https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf paper from Disney]
  47. (pdf), by Brent Burley.
  48. </p>
  49. <iframe
  50. id="scene"
  51. src="scenes/material-browser.html#MeshStandardMaterial"
  52. ></iframe>
  53. <script>
  54. // iOS iframe auto-resize workaround
  55. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  56. const scene = document.getElementById( 'scene' );
  57. scene.style.width = getComputedStyle( scene ).width;
  58. scene.style.height = getComputedStyle( scene ).height;
  59. scene.setAttribute( 'scrolling', 'no' );
  60. }
  61. </script>
  62. <h2>Constructor</h2>
  63. <h3>[name]( [param:Object parameters] )</h3>
  64. <p>
  65. [page:Object parameters] - (optional) an object with one or more
  66. properties defining the material's appearance. Any property of the
  67. material (including any property inherited from [page:Material]) can be
  68. passed in here.<br /><br />
  69. The exception is the property [page:Hexadecimal color], which can be
  70. passed in as a hexadecimal string and is `0xffffff` (white) by default.
  71. [page:Color.set]( color ) is called internally.
  72. </p>
  73. <h2>Properties</h2>
  74. <p>See the base [page:Material] class for common properties.</p>
  75. <h3>[property:Texture alphaMap]</h3>
  76. <p>
  77. The alpha map is a grayscale texture that controls the opacity across the
  78. surface (black: fully transparent; white: fully opaque). Default is
  79. null.<br /><br />
  80. Only the color of the texture is used, ignoring the alpha channel if one
  81. exists. For RGB and RGBA textures, the [page:WebGLRenderer WebGL] renderer
  82. will use the green channel when sampling this texture due to the extra bit
  83. of precision provided for green in DXT-compressed and uncompressed RGB 565
  84. formats. Luminance-only and luminance/alpha textures will also still work
  85. as expected.
  86. </p>
  87. <h3>[property:Texture aoMap]</h3>
  88. <p>
  89. The red channel of this texture is used as the ambient occlusion map.
  90. Default is null. The aoMap requires a second set of UVs.
  91. </p>
  92. <h3>[property:Float aoMapIntensity]</h3>
  93. <p>
  94. Intensity of the ambient occlusion effect. Range is 0-1, where `0`
  95. disables ambient occlusion. Where intensity is `1` and the [page:.aoMap]
  96. red channel is also `1`, ambient light is fully occluded on a surface.
  97. Default is `1`.
  98. </p>
  99. <h3>[property:Texture bumpMap]</h3>
  100. <p>
  101. The texture to create a bump map. The black and white values map to the
  102. perceived depth in relation to the lights. Bump doesn't actually affect
  103. the geometry of the object, only the lighting. If a normal map is defined
  104. this will be ignored.
  105. </p>
  106. <h3>[property:Float bumpScale]</h3>
  107. <p>
  108. How much the bump map affects the material. Typical ranges are 0-1.
  109. Default is `1`.
  110. </p>
  111. <h3>[property:Color color]</h3>
  112. <p>[page:Color] of the material, by default set to white (0xffffff).</p>
  113. <h3>[property:Object defines]</h3>
  114. <p>
  115. An object of the form:
  116. <code> { 'STANDARD': '' }; </code>
  117. This is used by the [page:WebGLRenderer] for selecting shaders.
  118. </p>
  119. <h3>[property:Texture displacementMap]</h3>
  120. <p>
  121. The displacement map affects the position of the mesh's vertices. Unlike
  122. other maps which only affect the light and shade of the material the
  123. displaced vertices can cast shadows, block other objects, and otherwise
  124. act as real geometry. The displacement texture is an image where the value
  125. of each pixel (white being the highest) is mapped against, and
  126. repositions, the vertices of the mesh.
  127. </p>
  128. <h3>[property:Float displacementScale]</h3>
  129. <p>
  130. How much the displacement map affects the mesh (where black is no
  131. displacement, and white is maximum displacement). Without a displacement
  132. map set, this value is not applied. Default is `1`.
  133. </p>
  134. <h3>[property:Float displacementBias]</h3>
  135. <p>
  136. The offset of the displacement map's values on the mesh's vertices.
  137. The bias is added to the scaled sample of the displacement map.
  138. Without a displacement map set, this value is not applied. Default is `0`.
  139. </p>
  140. <h3>[property:Color emissive]</h3>
  141. <p>
  142. Emissive (light) color of the material, essentially a solid color
  143. unaffected by other lighting. Default is black.
  144. </p>
  145. <h3>[property:Texture emissiveMap]</h3>
  146. <p>
  147. Set emissive (glow) map. Default is null. The emissive map color is
  148. modulated by the emissive color and the emissive intensity. If you have an
  149. emissive map, be sure to set the emissive color to something other than
  150. black.
  151. </p>
  152. <h3>[property:Float emissiveIntensity]</h3>
  153. <p>
  154. Intensity of the emissive light. Modulates the emissive color. Default is
  155. 1.
  156. </p>
  157. <h3>[property:Texture envMap]</h3>
  158. <p>
  159. The environment map. To ensure a physically correct rendering, you should
  160. only add environment maps which were preprocessed by
  161. [page:PMREMGenerator]. Default is null.
  162. </p>
  163. <h3>[property:Euler envMapRotation]</h3>
  164. <p>
  165. The rotation of the environment map in radians. Default is `(0,0,0)`.
  166. </p>
  167. <h3>[property:Float envMapIntensity]</h3>
  168. <p>Scales the effect of the environment map by multiplying its color.</p>
  169. <h3>[property:Boolean flatShading]</h3>
  170. <p>
  171. Define whether the material is rendered with flat shading. Default is
  172. false.
  173. </p>
  174. <h3>[property:Boolean fog]</h3>
  175. <p>Whether the material is affected by fog. Default is `true`.</p>
  176. <h3>[property:Boolean isMeshStandardMaterial]</h3>
  177. <p>Read-only flag to check if a given object is of type [name].</p>
  178. <h3>[property:Texture lightMap]</h3>
  179. <p>
  180. The light map. Default is null. The lightMap requires a second set of UVs.
  181. </p>
  182. <h3>[property:Float lightMapIntensity]</h3>
  183. <p>Intensity of the baked light. Default is `1`.</p>
  184. <h3>[property:Texture map]</h3>
  185. <p>
  186. The color map. May optionally include an alpha channel, typically combined
  187. with [page:Material.transparent .transparent] or [page:Material.alphaTest .alphaTest].
  188. Default is null. The texture map color is modulated by the diffuse [page:.color].
  189. </p>
  190. <h3>[property:Float metalness]</h3>
  191. <p>
  192. How much the material is like a metal. Non-metallic materials such as wood
  193. or stone use `0.0`, metallic use `1.0`, with nothing (usually) in between.
  194. Default is `0.0`. A value between `0.0` and `1.0` could be used for a rusty
  195. metal look. If metalnessMap is also provided, both values are multiplied.
  196. </p>
  197. <h3>[property:Texture metalnessMap]</h3>
  198. <p>
  199. The blue channel of this texture is used to alter the metalness of the
  200. material.
  201. </p>
  202. <h3>[property:Texture normalMap]</h3>
  203. <p>
  204. The texture to create a normal map. The RGB values affect the surface
  205. normal for each pixel fragment and change the way the color is lit. Normal
  206. maps do not change the actual shape of the surface, only the lighting. In
  207. case the material has a normal map authored using the left handed
  208. convention, the y component of normalScale should be negated to compensate
  209. for the different handedness.
  210. </p>
  211. <h3>[property:Integer normalMapType]</h3>
  212. <p>
  213. The type of normal map.<br /><br />
  214. Options are [page:constant THREE.TangentSpaceNormalMap] (default), and
  215. [page:constant THREE.ObjectSpaceNormalMap].
  216. </p>
  217. <h3>[property:Vector2 normalScale]</h3>
  218. <p>
  219. How much the normal map affects the material. Typical ranges are 0-1.
  220. Default is a [page:Vector2] set to (1,1).
  221. </p>
  222. <h3>[property:Float roughness]</h3>
  223. <p>
  224. How rough the material appears. `0.0` means a smooth mirror reflection, `1.0`
  225. means fully diffuse. Default is `1.0`. If roughnessMap is also provided,
  226. both values are multiplied.
  227. </p>
  228. <h3>[property:Texture roughnessMap]</h3>
  229. <p>
  230. The green channel of this texture is used to alter the roughness of the
  231. material.
  232. </p>
  233. <h3>[property:Boolean wireframe]</h3>
  234. <p>
  235. Render geometry as wireframe. Default is `false` (i.e. render as flat
  236. polygons).
  237. </p>
  238. <h3>[property:String wireframeLinecap]</h3>
  239. <p>
  240. Define appearance of line ends. Possible values are "butt", "round" and
  241. "square". Default is 'round'.<br /><br />
  242. This corresponds to the
  243. [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineCap 2D Canvas lineCap]
  244. property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
  245. </p>
  246. <h3>[property:String wireframeLinejoin]</h3>
  247. <p>
  248. Define appearance of line joints. Possible values are "round", "bevel" and
  249. "miter". Default is 'round'.<br /><br />
  250. This corresponds to the
  251. [link:https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/lineJoin 2D Canvas lineJoin]
  252. property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
  253. </p>
  254. <h3>[property:Float wireframeLinewidth]</h3>
  255. <p>
  256. Controls wireframe thickness. Default is `1`.<br /><br />
  257. Due to limitations of the
  258. [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]
  259. with the [page:WebGLRenderer WebGL] renderer on most
  260. platforms linewidth will always be `1` regardless of the set value.
  261. </p>
  262. <h2>Methods</h2>
  263. <p>See the base [page:Material] class for common methods.</p>
  264. <h2>Source</h2>
  265. <p>
  266. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  267. </p>
  268. </body>
  269. </html>
粤ICP备19079148号