1
0

MeshPhysicalMaterial.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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. [page:MeshStandardMaterial]的扩展,提供了更高级的基于物理的渲染属性:
  14. </p>
  15. <ul>
  16. <li>
  17. <b>Clearcoat:</b> 有些类似于车漆,碳纤,被水打湿的表面的材质需要在面上再增加一个透明的,具有一定反光特性的面。而且这个面说不定有一定的起伏与粗糙度。Clearcoat可以在不需要重新创建一个透明的面的情况下做到类似的效果。
  18. </li>
  19. <li>
  20. <b>基于物理的透明度</b>:[page:Material.opacity .opacity]属性有一些限制:在透明度比较高的时候,反射也随之减少。使用基于物理的透光性[page:.transmission]属性可以让一些很薄的透明表面,例如玻璃,变得更真实一些。
  21. </li>
  22. <li>
  23. <b>高级光线反射:</b> 为非金属材质提供了更多更灵活的光线反射。
  24. </li>
  25. <li>
  26. <b>Sheen:</b> Can be used for representing cloth and fabric materials.
  27. </li>
  28. </ul>
  29. <p>
  30. 物理网格材质使用了更复杂的着色器功能,所以在每个像素的渲染都要比three.js中的其他材质更费性能,大部分的特性是默认关闭的,需要手动开启,每开启一项功能在开启的时候才会更耗性能。请注意,为获得最佳效果,您在使用此材质时应始终指定[page:.envMap environment map]。
  31. </p>
  32. <iframe id="scene" src="scenes/material-browser.html#MeshPhysicalMaterial"></iframe>
  33. <script>
  34. // iOS iframe auto-resize workaround
  35. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  36. const scene = document.getElementById( 'scene' );
  37. scene.style.width = getComputedStyle( scene ).width;
  38. scene.style.height = getComputedStyle( scene ).height;
  39. scene.setAttribute( 'scrolling', 'no' );
  40. }
  41. </script>
  42. <h2>例子</h2>
  43. <p>
  44. [example:webgl_materials_physical_clearcoat materials / physical / clearcoat]<br />
  45. [example:webgl_loader_gltf_sheen loader / gltf / sheen]<br />
  46. [example:webgl_materials_physical_transmission materials / physical / transmission]
  47. </p>
  48. <h2>构造函数(Constructor)</h2>
  49. <h3>[name]( [param:Object parameters] )</h3>
  50. <p> [page:Object parameters] - (可选)用于定义材质外观的对象,具有一个或多个属性。
  51. 材质的任何属性都可以从此处传入(包括从[page:Material]和[page:MeshStandardMaterial]继承的任何属性)<br /><br />
  52. 属性[page:Hexadecimal color]例外,其可以作为十六进制字符串传递,默认情况下为 *0xffffff*(白色),内部调用[page:Color.set](color)。
  53. </p>
  54. <h2>属性(Properties)</h2>
  55. <p>共有属性请参见其基类[page:Material]和[page:MeshStandardMaterial]。</p>
  56. <h3>[property:Color attenuationColor]</h3>
  57. <p>
  58. The color that white light turns into due to absorption when reaching the attenuation distance. Default is *white* (0xffffff).
  59. </p>
  60. <h3>[property:Float attenuationDistance]</h3>
  61. <p>
  62. Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given in world space units, and must be greater than zero. Default is `Infinity`.
  63. </p>
  64. <h3>[property:Float clearcoat]</h3>
  65. <p>
  66. 表示clear coat层的强度,范围从*0.0*到*1.0*m,当需要在表面加一层薄薄的半透明材质的时候,可以使用与clear coat相关的属性,默认为*0.0*;
  67. </p>
  68. <h3>[property:Texture clearcoatMap]</h3>
  69. <p>
  70. 这个贴图的红色通道值会与[page:.clearcoat]相乘作为整个clear coat的强度值层,默认为*null*。
  71. </p>
  72. <h3>[property:Texture clearcoatNormalMap]</h3>
  73. <p>用于为clear coat层设置的独立的法线贴图,默认为*null*。</p>
  74. <h3>[property:Vector2 clearcoatNormalScale]</h3>
  75. <p>衡量[page:.clearcoatNormalMap]影响clear coat层多少的值,由*(0,0)*到*(1,1)*,默认为*(1,1)*。</p>
  76. <h3>[property:Float clearcoatRoughness]</h3>
  77. <p>clear coat层的粗糙度,由*0.0*到*1.0*。 默认为*0.0*</p>
  78. <h3>[property:Texture clearcoatRoughnessMap]</h3>
  79. <p>
  80. 此纹理的绿色通道值会与[page:.clearcoatRoughness]相乘,用于改变clear coat的粗糙度,默认为*null*
  81. </p>
  82. <h3>[property:Object defines]</h3>
  83. <p> 如下形式的对象:
  84. <code>
  85. {
  86. 'STANDARD': ''
  87. 'PHYSICAL': '',
  88. };
  89. </code>
  90. [page:WebGLRenderer]使用它来选择shaders。
  91. </p>
  92. <h3>[property:Float dispersion]</h3>
  93. <p>
  94. Defines the strength of the angular separation of colors (chromatic aberration) transmitting through a relatively clear volume.
  95. Any value zero or larger is valid, the typical range of realistic values is `[0, 1]`.
  96. Default is `0` (no dispersion).
  97. This property can be only be used with transmissive objects, see [page:.transmission].
  98. </p>
  99. <h3>[property:Float ior]</h3>
  100. <p>
  101. 为非金属材质所设置的折射率,范围由*1.0*到*2.333*。默认为*1.5*。
  102. <br />
  103. </p>
  104. <h3>[property:Float reflectivity]</h3>
  105. <p>
  106. 反射率,由*0.0*到*1.0*。默认为*0.5*, 相当于折射率1.5。
  107. <br />
  108. 这模拟了非金属材质的反射率。当[page:MeshStandardMaterial metalness]为*1.0*时,此属性无效。
  109. </p>
  110. <h3>[property:Float sheen]</h3>
  111. <p>
  112. 光泽层的强度,范围是*0.0*到*1.0*。默认为*0.0*。
  113. </p>
  114. <h3>[property:Float sheenRoughness]</h3>
  115. <p>
  116. 光泽层的粗糙度,由*0.0*到*1.0*。默认值是*1.0*。
  117. </p>
  118. <h3>[property:Texture sheenRoughnessMap]</h3>
  119. <p>
  120. 此纹理的透明通道会与[page:.sheenRoughness]相乘,用于改变光泽层的粗糙度,默认为*null*;
  121. </p>
  122. <h3>[property:Color sheenColor]</h3>
  123. <p>
  124. 光泽颜色,默认为*0x000000*黑色。
  125. </p>
  126. <h3>[property:Texture sheenColorMap]</h3>
  127. <p>
  128. 此纹理的RGB通道会与[page:.sheenColor]光泽颜色相乘,最终作为光泽颜色结果,默认为*null*。
  129. </p>
  130. <h3>[property:Float specularIntensity]</h3>
  131. <p>
  132. 用于控制非金属材质高光反射强度的浮点值。漫反射材质对应的值为0。范围从*0.0*到*1.0*。 默认值为*1.0*。
  133. </p>
  134. <h3>[property:Texture specularIntensityMap]</h3>
  135. <p>
  136. 此纹理的alpha通道将与[page:.specularIntensity]相乘,用于逐像素地控制高光强度。默认值为*null*。
  137. </p>
  138. <h3>[property:Color specularColor]</h3>
  139. <p>
  140. 非金属材质在垂直于法线方向观看时的高光反射颜色。默认值为*0xffffff*,白色。
  141. </p>
  142. <h3>[property:Texture specularColorMap]</h3>
  143. <p>
  144. 此纹理的alpha通道将与[page:.specularColor]相乘,用于逐像素地控制高光颜色。默认值为*null*。
  145. </p>
  146. <h3>[property:Float thickness]</h3>
  147. <p>
  148. The thickness of the volume beneath the surface. The value is given in the coordinate space of the mesh. If the value is 0 the material is thin-walled. Otherwise the material is a volume boundary. Default is *0*.
  149. </p>
  150. <h3>[property:Texture thicknessMap]</h3>
  151. <p>
  152. A texture that defines the thickness, stored in the G channel. This will be multiplied by [page:.thickness]. Default is *null*.
  153. </p>
  154. <h3>[property:Float transmission]</h3>
  155. <p>
  156. 透光率(或者说透光性),范围从*0.0*到*1.0*。默认值是*0.0*。<br />
  157. 很薄的透明或者半透明的塑料、玻璃材质即便在几乎完全透明的情况下仍旧会保留反射的光线,透光性属性用于这种类型的材质。<br />
  158. 当透光率不为0的时候, [page:Material.opacity opacity]透明度应设置为*1*.
  159. </p>
  160. <h3>[property:Texture transmissionMap]</h3>
  161. <p>
  162. 此纹理的红色通道会与透光性[page:.transmission]相乘最为最终的透光性结果。默认为*null*。
  163. </p>
  164. <h2>方法(Methods)</h2>
  165. <p>共有方法请参见其基类[page:Material] 和[page:MeshStandardMaterial]。</p>
  166. <h2>源码(Source)</h2>
  167. <p>
  168. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  169. </p>
  170. </body>
  171. </html>