MeshPhysicalMaterial.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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>Clearcoat:</b> Some materials — like car paints, carbon fiber, and
  19. wet surfaces — require a clear, reflective layer on top of another layer
  20. that may be irregular or rough. Clearcoat approximates this effect,
  21. without the need for a separate transparent surface.
  22. </li>
  23. <li>
  24. <b>Physically-based transparency:</b> One limitation of
  25. [page:Material.opacity .opacity] is that highly transparent materials
  26. are less reflective. Physically-based [page:.transmission] provides a
  27. more realistic option for thin, transparent surfaces like glass.
  28. </li>
  29. <li>
  30. <b>Advanced reflectivity:</b> More flexible reflectivity for
  31. non-metallic materials.
  32. </li>
  33. <li>
  34. <b>Sheen:</b> Can be used for representing cloth and fabric materials.
  35. </li>
  36. </ul>
  37. <p>
  38. As a result of these complex shading features, MeshPhysicalMaterial has a
  39. higher performance cost, per pixel, than other three.js materials. Most
  40. effects are disabled by default, and add cost as they are enabled. For
  41. best results, always specify an [page:.envMap environment map] when using
  42. this material.
  43. </p>
  44. <iframe
  45. id="scene"
  46. src="scenes/material-browser.html#MeshPhysicalMaterial"
  47. ></iframe>
  48. <script>
  49. // iOS iframe auto-resize workaround
  50. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  51. const scene = document.getElementById( 'scene' );
  52. scene.style.width = getComputedStyle( scene ).width;
  53. scene.style.height = getComputedStyle( scene ).height;
  54. scene.setAttribute( 'scrolling', 'no' );
  55. }
  56. </script>
  57. <h2>Examples</h2>
  58. <p>
  59. [example:webgl_materials_variations_physical materials / variations / physical]<br />
  60. [example:webgl_materials_physical_clearcoat materials / physical / clearcoat]<br />
  61. [example:webgl_loader_gltf_sheen loader / gltf / sheen]<br />
  62. [example:webgl_materials_physical_transmission materials / physical / transmission]
  63. </p>
  64. <h2>Constructor</h2>
  65. <h3>[name]( [param:Object parameters] )</h3>
  66. <p>
  67. [page:Object parameters] - (optional) an object with one or more
  68. properties defining the material's appearance. Any property of the
  69. material (including any property inherited from [page:Material] and
  70. [page:MeshStandardMaterial]) can be passed in here.<br /><br />
  71. The exception is the property [page:Hexadecimal color], which can be
  72. passed in as a hexadecimal string and is `0xffffff` (white) by default.
  73. [page:Color.set]( color ) is called internally.
  74. </p>
  75. <h2>Properties</h2>
  76. <p>
  77. See the base [page:Material] and [page:MeshStandardMaterial] classes for
  78. common properties.
  79. </p>
  80. <h3>[property:Color attenuationColor]</h3>
  81. <p>
  82. The color that white light turns into due to absorption when reaching the
  83. attenuation distance. Default is `white` (0xffffff).
  84. </p>
  85. <h3>[property:Float attenuationDistance]</h3>
  86. <p>
  87. Density of the medium given as the average distance that light travels in
  88. the medium before interacting with a particle. The value is given in world
  89. space units, and must be greater than zero. Default is `Infinity`.
  90. </p>
  91. <h3>[property:Float clearcoat]</h3>
  92. <p>
  93. Represents the intensity of the clear coat layer, from `0.0` to `1.0`. Use
  94. clear coat related properties to enable multilayer materials that have a
  95. thin translucent layer over the base layer. Default is `0.0`.
  96. </p>
  97. <h3>[property:Texture clearcoatMap]</h3>
  98. <p>
  99. The red channel of this texture is multiplied against [page:.clearcoat],
  100. for per-pixel control over a coating's intensity. Default is `null`.
  101. </p>
  102. <h3>[property:Texture clearcoatNormalMap]</h3>
  103. <p>
  104. Can be used to enable independent normals for the clear coat layer.
  105. Default is `null`.
  106. </p>
  107. <h3>[property:Vector2 clearcoatNormalScale]</h3>
  108. <p>
  109. How much [page:.clearcoatNormalMap] affects the clear coat layer, from
  110. `(0,0)` to `(1,1)`. Default is `(1,1)`.
  111. </p>
  112. <h3>[property:Float clearcoatRoughness]</h3>
  113. <p>
  114. Roughness of the clear coat layer, from `0.0` to `1.0`. Default is `0.0`.
  115. </p>
  116. <h3>[property:Texture clearcoatRoughnessMap]</h3>
  117. <p>
  118. The green channel of this texture is multiplied against
  119. [page:.clearcoatRoughness], for per-pixel control over a coating's
  120. roughness. Default is `null`.
  121. </p>
  122. <h3>[property:Object defines]</h3>
  123. <p>
  124. An object of the form:
  125. <code>
  126. {
  127. 'STANDARD': '',
  128. 'PHYSICAL': '',
  129. };
  130. </code>
  131. This is used by the [page:WebGLRenderer] for selecting shaders.
  132. </p>
  133. <h3>[property:Float ior]</h3>
  134. <p>
  135. Index-of-refraction for non-metallic materials, from `1.0` to `2.333`.
  136. Default is `1.5`.<br />
  137. </p>
  138. <h3>[property:Float reflectivity]</h3>
  139. <p>
  140. Degree of reflectivity, from `0.0` to `1.0`. Default is `0.5`, which
  141. corresponds to an index-of-refraction of 1.5.<br />
  142. This models the reflectivity of non-metallic materials. It has no effect
  143. when [page:MeshStandardMaterial.metalness metalness] is `1.0`
  144. </p>
  145. <h3>[property:Float sheen]</h3>
  146. <p>
  147. The intensity of the sheen layer, from `0.0` to `1.0`. Default is `0.0`.
  148. </p>
  149. <h3>[property:Float sheenRoughness]</h3>
  150. <p>Roughness of the sheen layer, from `0.0` to `1.0`. Default is `1.0`.</p>
  151. <h3>[property:Texture sheenRoughnessMap]</h3>
  152. <p>
  153. The alpha channel of this texture is multiplied against
  154. [page:.sheenRoughness], for per-pixel control over sheen roughness.
  155. Default is `null`.
  156. </p>
  157. <h3>[property:Color sheenColor]</h3>
  158. <p>The sheen tint. Default is `0xffffff`, white.</p>
  159. <h3>[property:Texture sheenColorMap]</h3>
  160. <p>
  161. The RGB channels of this texture are multiplied against
  162. [page:.sheenColor], for per-pixel control over sheen tint. Default is
  163. `null`.
  164. </p>
  165. <h3>[property:Float specularIntensity]</h3>
  166. <p>
  167. A float that scales the amount of specular reflection for non-metals only.
  168. When set to zero, the model is effectively Lambertian. From `0.0` to
  169. `1.0`. Default is `0.0`.
  170. </p>
  171. <h3>[property:Texture specularIntensityMap]</h3>
  172. <p>
  173. The alpha channel of this texture is multiplied against
  174. [page:.specularIntensity], for per-pixel control over specular intensity.
  175. Default is `null`.
  176. </p>
  177. <h3>[property:Color specularColor]</h3>
  178. <p>
  179. A [page:Color] that tints the specular reflection at normal incidence for
  180. non-metals only. Default is `0xffffff`, white.
  181. </p>
  182. <h3>[property:Texture specularColorMap]</h3>
  183. <p>
  184. The RGB channels of this texture are multiplied against
  185. [page:.specularColor], for per-pixel control over specular color. Default
  186. is `null`.
  187. </p>
  188. <h3>[property:Float thickness]</h3>
  189. <p>
  190. The thickness of the volume beneath the surface. The value is given in the
  191. coordinate space of the mesh. If the value is 0 the material is
  192. thin-walled. Otherwise the material is a volume boundary. Default is `0`.
  193. </p>
  194. <h3>[property:Texture thicknessMap]</h3>
  195. <p>
  196. A texture that defines the thickness, stored in the G channel. This will
  197. be multiplied by [page:.thickness]. Default is `null`.
  198. </p>
  199. <h3>[property:Float transmission]</h3>
  200. <p>
  201. Degree of transmission (or optical transparency), from `0.0` to `1.0`.
  202. Default is `0.0`.<br />
  203. Thin, transparent or semitransparent, plastic or glass materials remain
  204. largely reflective even if they are fully transmissive. The transmission
  205. property can be used to model these materials.<br />
  206. When transmission is non-zero, [page:Material.opacity opacity] should be
  207. set to `0`.
  208. </p>
  209. <h3>[property:Texture transmissionMap]</h3>
  210. <p>
  211. The red channel of this texture is multiplied against
  212. [page:.transmission], for per-pixel control over optical transparency.
  213. Default is `null`.
  214. </p>
  215. <h2>Methods</h2>
  216. <p>
  217. See the base [page:Material] and [page:MeshStandardMaterial] classes for
  218. common methods.
  219. </p>
  220. <h2>Source</h2>
  221. <p>
  222. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  223. </p>
  224. </body>
  225. </html>