[page:Material] → [page:MeshStandardMaterial] →

物理网格材质([name])

[page:MeshStandardMaterial]的扩展,提供了更高级的基于物理的渲染属性:

物理网格材质使用了更复杂的着色器功能,所以在每个像素的渲染都要比three.js中的其他材质更费性能,大部分的特性是默认关闭的,需要手动开启,每开启一项功能在开启的时候才会更耗性能。请注意,为获得最佳效果,您在使用此材质时应始终指定[page:.envMap environment map]。

例子

[example:webgl_materials_variations_physical materials / variations / physical]
[example:webgl_materials_physical_clearcoat materials / physical / clearcoat]
[example:webgl_materials_physical_reflectivity materials / physical / reflectivity]
[example:webgl_loader_gltf_sheen loader / gltf / sheen]
[example:webgl_materials_physical_transmission materials / physical / transmission]

构造函数(Constructor)

[name]( [param:Object parameters] )

[page:Object parameters] - (可选)用于定义材质外观的对象,具有一个或多个属性。 材质的任何属性都可以从此处传入(包括从[page:Material]和[page:MeshStandardMaterial]继承的任何属性)

属性[page:Hexadecimal color]例外,其可以作为十六进制字符串传递,默认情况下为 *0xffffff*(白色),内部调用[page:Color.set](color)。

属性(Properties)

共有属性请参见其基类[page:Material]和[page:MeshStandardMaterial]。

[property:Color attenuationColor]

The color that white light turns into due to absorption when reaching the attenuation distance. Default is *white* (0xffffff).

[property:Float attenuationDistance]

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`.

[property:Float clearcoat]

表示clear coat层的强度,范围从*0.0*到*1.0*m,当需要在表面加一层薄薄的半透明材质的时候,可以使用与clear coat相关的属性,默认为*0.0*;

[property:Texture clearcoatMap]

这个贴图的红色通道值会与[page:.clearcoat]相乘作为整个clear coat的强度值层,默认为*null*。

[property:Texture clearcoatNormalMap]

用于为clear coat层设置的独立的法线贴图,默认为*null*。

[property:Vector2 clearcoatNormalScale]

衡量[page:.clearcoatNormalMap]影响clear coat层多少的值,由*(0,0)*到*(1,1)*,默认为*(1,1)*。

[property:Float clearcoatRoughness]

clear coat层的粗糙度,由*0.0*到*1.0*。 默认为*0.0*

[property:Texture clearcoatRoughnessMap]

此纹理的绿色通道值会与[page:.clearcoatRoughness]相乘,用于改变clear coat的粗糙度,默认为*null*

[property:Object defines]

如下形式的对象: { 'STANDARD': '' 'PHYSICAL': '', }; [page:WebGLRenderer]使用它来选择shaders。

[property:Float ior]

为非金属材质所设置的折射率,范围由*1.0*到*2.333*。默认为*1.5*。

[property:Float reflectivity]

反射率,由*0.0*到*1.0*。默认为*0.5*, 相当于折射率1.5。
这模拟了非金属材质的反射率。当[page:MeshStandardMaterial metalness]为*1.0*时,此属性无效。

[property:Float sheen]

光泽层的强度,范围是*0.0*到*1.0*。默认为*0.0*。

[property:Float sheenRoughness]

光泽层的粗糙度,由*0.0*到*1.0*。默认值是*1.0*。

[property:Texture sheenRoughnessMap]

此纹理的透明通道会与[page:.sheenRoughness]相乘,用于改变光泽层的粗糙度,默认为*null*;

[property:Color sheenColor]

光泽颜色,默认为*0xffffff*白色。

[property:Texture sheenColorMap]

此纹理的RGB通道会与[page:.sheenColor]光泽颜色相乘,最终作为光泽颜色结果,默认为*null*。

[property:Float specularIntensity]

用于控制非金属材质高光反射强度的浮点值。漫反射材质对应的值为0。范围从*0.0*到*1.0*。 默认值为*0.0*。

[property:Texture specularIntensityMap]

此纹理的alpha通道将与[page:.specularIntensity]相乘,用于逐像素地控制高光强度。默认值为*null*。

[property:Color specularColor]

非金属材质在垂直于法线方向观看时的高光反射颜色。默认值为*0xffffff*,白色。

[property:Texture specularColorMap]

此纹理的alpha通道将与[page:.specularColor]相乘,用于逐像素地控制高光颜色。默认值为*null*。

[property:Float thickness]

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*.

[property:Texture thicknessMap]

A texture that defines the thickness, stored in the G channel. This will be multiplied by [page:.thickness]. Default is *null*.

[property:Float transmission]

透光率(或者说透光性),范围从*0.0*到*1.0*。默认值是*0.0*。
很薄的透明或者半透明的塑料、玻璃材质即便在几乎完全透明的情况下仍旧会保留反射的光线,透光性属性用于这种类型的材质。
当透光率不为0的时候, [page:Material.opacity opacity]透明度应设置为*1*.

[property:Texture transmissionMap]

此纹理的红色通道会与透光性[page:.transmission]相乘最为最终的透光性结果。默认为*null*。

方法(Methods)

共有方法请参见其基类[page:Material] 和[page:MeshStandardMaterial]。

源码(Source)

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]