2
0

MeshPhysicalMaterial.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 physically-based rendering properties:
  14. </p>
  15. <ul>
  16. <li>
  17. <b>Clearcoat:</b> Some materials — like car paints, carbon fiber, and wet surfaces — require a
  18. clear, reflective layer on top of another layer that may be irregular or rough. Clearcoat
  19. approximates this effect, without the need for a separate transparent surface.
  20. </li>
  21. <li>
  22. <b>Physically-based transparency:</b> One limitation of [page:Material.opacity .opacity] is
  23. that highly transparent materials are less reflective. Physically-based [page:.transmission]
  24. provides a more realistic option for thin, transparent surfaces like glass.
  25. </li>
  26. <li>
  27. <b>Advanced reflectivity:</b> More flexible reflectivity for non-metallic materials.
  28. </li>
  29. </ul>
  30. <p>
  31. As a result of these complex shading features, MeshPhysicalMaterial has a higher performance
  32. cost, per pixel, than other three.js materials. Most effects are disabled by default, and add
  33. cost as they are enabled. For best results, always specify an [page:.envMap environment map]
  34. when using this material.
  35. </p>
  36. <iframe id="scene" src="scenes/material-browser.html#MeshPhysicalMaterial"></iframe>
  37. <script>
  38. // iOS iframe auto-resize workaround
  39. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  40. const scene = document.getElementById( 'scene' );
  41. scene.style.width = getComputedStyle( scene ).width;
  42. scene.style.height = getComputedStyle( scene ).height;
  43. scene.setAttribute( 'scrolling', 'no' );
  44. }
  45. </script>
  46. <h2>Examples</h2>
  47. <p>
  48. [example:webgl_materials_variations_physical materials / variations / physical]<br />
  49. [example:webgl_materials_physical_clearcoat materials / physical / clearcoat]<br />
  50. [example:webgl_materials_physical_reflectivity materials / physical / reflectivity]<br />
  51. [example:webgl_materials_physical_sheen materials / physical / sheen]<br />
  52. [example:webgl_materials_physical_transmission materials / physical / transmission]
  53. </p>
  54. <h2>Constructor</h2>
  55. <h3>[name]( [param:Object parameters] )</h3>
  56. <p>
  57. [page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
  58. Any property of the material (including any property inherited from [page:Material] and [page:MeshStandardMaterial]) can be passed in here.<br /><br />
  59. The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal
  60. string and is *0xffffff* (white) by default. [page:Color.set]( color ) is called internally.
  61. </p>
  62. <h2>Properties</h2>
  63. <p>See the base [page:Material] and [page:MeshStandardMaterial] classes for common properties.</p>
  64. <h3>[property:Float clearcoat]</h3>
  65. <p>
  66. Represents the thickness of the clear coat layer, from *0.0* to *1.0*. Use clear coat related properties to enable multilayer
  67. materials that have a thin translucent layer over the base layer. Default is *0.0*.
  68. </p>
  69. <h3>[property:Texture clearcoatMap]</h3>
  70. <p>
  71. The red channel of this texture is multiplied against [page:.clearcoat], for per-pixel control
  72. over a coating's thickness. Default is *null*.
  73. </p>
  74. <h3>[property:Texture clearcoatNormalMap]</h3>
  75. <p>Can be used to enable independent normals for the clear coat layer. Default is *null*.</p>
  76. <h3>[property:Vector2 clearcoatNormalScale]</h3>
  77. <p>How much [page:.clearcoatNormalMap] affects the clear coat layer, from *(0,0)* to *(1,1)*. Default is *(1,1)*.</p>
  78. <h3>[property:Float clearcoatRoughness]</h3>
  79. <p>Roughness of the clear coat layer, from *0.0* to *1.0*. Default is *0.0*.</p>
  80. <h3>[property:Texture clearcoatRoughnessMap]</h3>
  81. <p>
  82. The green channel of this texture is multiplied against [page:.clearcoatRoughness], for per-pixel control
  83. over a coating's roughness. Default is *null*.
  84. </p>
  85. <h3>[property:Object defines]</h3>
  86. <p>An object of the form:
  87. <code>
  88. {
  89. 'STANDARD': ''
  90. 'PHYSICAL': '',
  91. };
  92. </code>
  93. This is used by the [page:WebGLRenderer] for selecting shaders.
  94. </p>
  95. <h3>[property:Float ior]</h3>
  96. <p>
  97. Index-of-refraction for non-metallic materials, from *1.0* to *2.333*. Default is *1.5*.<br />
  98. </p>
  99. <h3>[property:Float reflectivity]</h3>
  100. <p>
  101. Degree of reflectivity, from *0.0* to *1.0*. Default is *0.5*, which corresponds to an index-of-refraction of 1.5.<br />
  102. This models the reflectivity of non-metallic materials. It has no effect when [page:MeshStandardMaterial.metalness metalness] is *1.0*
  103. </p>
  104. <h3>[property:Color sheen]</h3>
  105. <p>
  106. If a color is assigned to this property, the material will use a special sheen BRDF intended for rendering cloth materials such as velvet.
  107. The sheen color provides the ability to create two-tone specular materials. *null* by default.
  108. </p>
  109. <h3>[property:Float transmission]</h3>
  110. <p>
  111. Degree of transmission (or optical transparency), from *0.0* to *1.0*. Default is *0.0*.<br />
  112. Thin, transparent or semitransparent, plastic or glass materials remain largely reflective even if they are fully transmissive.
  113. The transmission property can be used to model these materials.<br />
  114. When transmission is non-zero, [page:Material.opacity opacity] should be set to *1*.
  115. </p>
  116. <h3>[property:Texture transmissionMap]</h3>
  117. <p>
  118. The red channel of this texture is multiplied against [page:.transmission], for per-pixel control
  119. over optical transparency. Default is *null*.
  120. </p>
  121. <h2>Methods</h2>
  122. <p>See the base [page:Material] and [page:MeshStandardMaterial] classes for common methods.</p>
  123. <h2>Source</h2>
  124. <p>
  125. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  126. </p>
  127. </body>
  128. </html>