MeshPhysicalMaterial.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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; [page:MeshStandardMaterial] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. An extension of the [page:MeshStandardMaterial], providing more advanced
  14. physically-based rendering properties:
  15. </p>
  16. <ul>
  17. <li>
  18. <b>Anisotropy:</b> Ability to represent the anisotropic property of materials
  19. as observable with brushed metals.
  20. </li>
  21. <li>
  22. <b>Clearcoat:</b> Some materials — like car paints, carbon fiber, and
  23. wet surfaces — require a clear, reflective layer on top of another layer
  24. that may be irregular or rough. Clearcoat approximates this effect,
  25. without the need for a separate transparent surface.
  26. </li>
  27. <li>
  28. <b>Iridescence:</b> Allows to render the effect where hue varies
  29. depending on the viewing angle and illumination angle. This can be seen on
  30. soap bubbles, oil films, or on the wings of many insects.
  31. </li>
  32. <li>
  33. <b>Physically-based transparency:</b> One limitation of
  34. [page:Material.opacity .opacity] is that highly transparent materials
  35. are less reflective. Physically-based [page:.transmission] provides a
  36. more realistic option for thin, transparent surfaces like glass.
  37. </li>
  38. <li>
  39. <b>Advanced reflectivity:</b> More flexible reflectivity for
  40. non-metallic materials.
  41. </li>
  42. <li>
  43. <b>Sheen:</b> Can be used for representing cloth and fabric materials.
  44. </li>
  45. </ul>
  46. <p>
  47. As a result of these complex shading features, MeshPhysicalMaterial has a
  48. higher performance cost, per pixel, than other three.js materials. Most
  49. effects are disabled by default, and add cost as they are enabled. For
  50. best results, always specify an [page:.envMap environment map] when using
  51. this material.
  52. </p>
  53. <iframe
  54. id="scene"
  55. src="scenes/material-browser.html#MeshPhysicalMaterial"
  56. ></iframe>
  57. <script>
  58. // iOS iframe auto-resize workaround
  59. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  60. const scene = document.getElementById( 'scene' );
  61. scene.style.width = getComputedStyle( scene ).width;
  62. scene.style.height = getComputedStyle( scene ).height;
  63. scene.setAttribute( 'scrolling', 'no' );
  64. }
  65. </script>
  66. <h2>Examples</h2>
  67. <p>
  68. [example:webgl_loader_gltf_anisotropy loader / gltf / anisotropy]<br />
  69. [example:webgl_materials_physical_clearcoat materials / physical / clearcoat]<br />
  70. [example:webgl_loader_gltf_iridescence loader / gltf / iridescence]<br />
  71. [example:webgl_loader_gltf_sheen loader / gltf / sheen]<br />
  72. [example:webgl_materials_physical_transmission materials / physical / transmission]
  73. </p>
  74. <h2>Constructor</h2>
  75. <h3>[name]( [param:Object parameters] )</h3>
  76. <p>
  77. [page:Object parameters] - (optional) an object with one or more
  78. properties defining the material's appearance. Any property of the
  79. material (including any property inherited from [page:Material] and
  80. [page:MeshStandardMaterial]) can be passed in here.<br /><br />
  81. The exception is the property [page:Hexadecimal color], which can be
  82. passed in as a hexadecimal string and is `0xffffff` (white) by default.
  83. [page:Color.set]( color ) is called internally.
  84. </p>
  85. <h2>Properties</h2>
  86. <p>
  87. See the base [page:Material] and [page:MeshStandardMaterial] classes for
  88. common properties.
  89. </p>
  90. <h3>[property:Float anisotropy]</h3>
  91. <p>
  92. The anisotropy strength. Default is `0.0`.
  93. </p>
  94. <h3>[property:Texture anisotropyMap]</h3>
  95. <p>
  96. Red and green channels represent the anisotropy direction in `[-1, 1]` tangent,
  97. bitangent space, to be rotated by [page:.anisotropyRotation]. The blue channel
  98. contains strength as `[0, 1]` to be multiplied by [page:.anisotropy]. Default is `null`.
  99. </p>
  100. <h3>[property:Float anisotropyRotation]</h3>
  101. <p>
  102. The rotation of the anisotropy in tangent, bitangent space, measured in radians
  103. counter-clockwise from the tangent. When [page:.anisotropyMap] is present, this
  104. property provides additional rotation to the vectors in the texture. Default is `0.0`.
  105. </p>
  106. <h3>[property:Color attenuationColor]</h3>
  107. <p>
  108. The color that white light turns into due to absorption when reaching the
  109. attenuation distance. Default is `white` (0xffffff).
  110. </p>
  111. <h3>[property:Float attenuationDistance]</h3>
  112. <p>
  113. Density of the medium given as the average distance that light travels in
  114. the medium before interacting with a particle. The value is given in world
  115. space units, and must be greater than zero. Default is `Infinity`.
  116. </p>
  117. <h3>[property:Float clearcoat]</h3>
  118. <p>
  119. Represents the intensity of the clear coat layer, from `0.0` to `1.0`. Use
  120. clear coat related properties to enable multilayer materials that have a
  121. thin translucent layer over the base layer. Default is `0.0`.
  122. </p>
  123. <h3>[property:Texture clearcoatMap]</h3>
  124. <p>
  125. The red channel of this texture is multiplied against [page:.clearcoat],
  126. for per-pixel control over a coating's intensity. Default is `null`.
  127. </p>
  128. <h3>[property:Texture clearcoatNormalMap]</h3>
  129. <p>
  130. Can be used to enable independent normals for the clear coat layer.
  131. Default is `null`.
  132. </p>
  133. <h3>[property:Vector2 clearcoatNormalScale]</h3>
  134. <p>
  135. How much [page:.clearcoatNormalMap] affects the clear coat layer, from
  136. `(0,0)` to `(1,1)`. Default is `(1,1)`.
  137. </p>
  138. <h3>[property:Float clearcoatRoughness]</h3>
  139. <p>
  140. Roughness of the clear coat layer, from `0.0` to `1.0`. Default is `0.0`.
  141. </p>
  142. <h3>[property:Texture clearcoatRoughnessMap]</h3>
  143. <p>
  144. The green channel of this texture is multiplied against
  145. [page:.clearcoatRoughness], for per-pixel control over a coating's
  146. roughness. Default is `null`.
  147. </p>
  148. <h3>[property:Object defines]</h3>
  149. <p>
  150. An object of the form:
  151. <code>
  152. {
  153. 'STANDARD': '',
  154. 'PHYSICAL': '',
  155. };
  156. </code>
  157. This is used by the [page:WebGLRenderer] for selecting shaders.
  158. </p>
  159. <h3>[property:Float dispersion]</h3>
  160. <p>
  161. Defines the strength of the angular separation of colors (chromatic aberration) transmitting through a relatively clear volume.
  162. Any value zero or larger is valid, the typical range of realistic values is `[0, 1]`.
  163. Default is `0` (no dispersion).
  164. This property can be only be used with transmissive objects, see [page:.transmission].
  165. </p>
  166. <h3>[property:Float ior]</h3>
  167. <p>
  168. Index-of-refraction for non-metallic materials, from `1.0` to `2.333`.
  169. Default is `1.5`.
  170. </p>
  171. <h3>[property:Float reflectivity]</h3>
  172. <p>
  173. Degree of reflectivity, from `0.0` to `1.0`. Default is `0.5`, which
  174. corresponds to an index-of-refraction of 1.5.<br />
  175. This models the reflectivity of non-metallic materials. It has no effect
  176. when [page:MeshStandardMaterial.metalness metalness] is `1.0`
  177. </p>
  178. <h3>[property:Float iridescence]</h3>
  179. <p>
  180. The intensity of the [link:https://en.wikipedia.org/wiki/Iridescence iridescence] layer, simulating RGB color shift based on the angle between the surface and the viewer, from `0.0` to `1.0`. Default is `0.0`.
  181. </p>
  182. <h3>[property:Texture iridescenceMap]</h3>
  183. <p>
  184. The red channel of this texture is multiplied against
  185. [page:.iridescence], for per-pixel control over iridescence.
  186. Default is `null`.
  187. </p>
  188. <h3>[property:Float iridescenceIOR]</h3>
  189. <p>
  190. Strength of the iridescence RGB color shift effect, represented by an index-of-refraction. Between `1.0` to `2.333`.
  191. Default is `1.3`.
  192. </p>
  193. <h3>[property:Array iridescenceThicknessRange]</h3>
  194. <p>
  195. Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer.
  196. Thickness of iridescence layer has an equivalent effect of the one [page:.thickness] has on [page:.ior].
  197. Default is `[100, 400]`.<br />
  198. If [page:.iridescenceThicknessMap] is not defined, iridescence thickness will use only the second element of the given array.
  199. </p>
  200. <h3>[property:Texture iridescenceThicknessMap]</h3>
  201. <p>
  202. A texture that defines the thickness of the iridescence layer, stored in the green channel.
  203. Minimum and maximum values of thickness are defined by [page:.iridescenceThicknessRange] array:<br/>
  204. <ul>
  205. <li>`0.0` in the green channel will result in thickness equal to first element of the array.</li>
  206. <li>`1.0` in the green channel will result in thickness equal to second element of the array.</li>
  207. <li>Values in-between will linearly interpolate between the elements of the array.</li>
  208. </ul>
  209. Default is `null`.
  210. </p>
  211. <h3>[property:Float sheen]</h3>
  212. <p>
  213. The intensity of the sheen layer, from `0.0` to `1.0`. Default is `0.0`.
  214. </p>
  215. <h3>[property:Float sheenRoughness]</h3>
  216. <p>Roughness of the sheen layer, from `0.0` to `1.0`. Default is `1.0`.</p>
  217. <h3>[property:Texture sheenRoughnessMap]</h3>
  218. <p>
  219. The alpha channel of this texture is multiplied against
  220. [page:.sheenRoughness], for per-pixel control over sheen roughness.
  221. Default is `null`.
  222. </p>
  223. <h3>[property:Color sheenColor]</h3>
  224. <p>The sheen tint. Default is `0x000000`, black.</p>
  225. <h3>[property:Texture sheenColorMap]</h3>
  226. <p>
  227. The RGB channels of this texture are multiplied against
  228. [page:.sheenColor], for per-pixel control over sheen tint. Default is
  229. `null`.
  230. </p>
  231. <h3>[property:Float specularIntensity]</h3>
  232. <p>
  233. A float that scales the amount of specular reflection for non-metals only.
  234. When set to zero, the model is effectively Lambertian. From `0.0` to
  235. `1.0`. Default is `1.0`.
  236. </p>
  237. <h3>[property:Texture specularIntensityMap]</h3>
  238. <p>
  239. The alpha channel of this texture is multiplied against
  240. [page:.specularIntensity], for per-pixel control over specular intensity.
  241. Default is `null`.
  242. </p>
  243. <h3>[property:Color specularColor]</h3>
  244. <p>
  245. A [page:Color] that tints the specular reflection at normal incidence for
  246. non-metals only. Default is `0xffffff`, white.
  247. </p>
  248. <h3>[property:Texture specularColorMap]</h3>
  249. <p>
  250. The RGB channels of this texture are multiplied against
  251. [page:.specularColor], for per-pixel control over specular color. Default
  252. is `null`.
  253. </p>
  254. <h3>[property:Float thickness]</h3>
  255. <p>
  256. The thickness of the volume beneath the surface. The value is given in the
  257. coordinate space of the mesh. If the value is `0` the material is
  258. thin-walled. Otherwise the material is a volume boundary. Default is `0`.
  259. </p>
  260. <h3>[property:Texture thicknessMap]</h3>
  261. <p>
  262. A texture that defines the thickness, stored in the green channel. This will
  263. be multiplied by [page:.thickness]. Default is `null`.
  264. </p>
  265. <h3>[property:Float transmission]</h3>
  266. <p>
  267. Degree of transmission (or optical transparency), from `0.0` to `1.0`.
  268. Default is `0.0`.<br />
  269. Thin, transparent or semitransparent, plastic or glass materials remain
  270. largely reflective even if they are fully transmissive. The transmission
  271. property can be used to model these materials.<br />
  272. When transmission is non-zero, [page:Material.opacity opacity] should be
  273. set to `1`.
  274. </p>
  275. <h3>[property:Texture transmissionMap]</h3>
  276. <p>
  277. The red channel of this texture is multiplied against
  278. [page:.transmission], for per-pixel control over optical transparency.
  279. Default is `null`.
  280. </p>
  281. <h2>Methods</h2>
  282. <p>
  283. See the base [page:Material] and [page:MeshStandardMaterial] classes for
  284. common methods.
  285. </p>
  286. <h2>Source</h2>
  287. <p>
  288. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  289. </p>
  290. </body>
  291. </html>