pygfx.materials.MeshStandardMaterial
- class pygfx.materials.MeshStandardMaterial(emissive='#000', metalness=0.0, roughness=1.0, **kwargs)
Bases:
MeshBasicMaterial
PBR shaded material.
A standard physically based material, applying PBR (Physically based rendering) using the Metallic-Roughness workflow.
- Parameters:
emissive (Color) – The emissive color of the mesh. I.e. the color that the object emits even when not lit by a light source. This color is added to the final color and unaffected by lighting. The alpha channel is ignored.
metalness (float) – How much the material looks like a metal. Non-metallic materials such as wood or stone use 0.0, metal use 1.0, with nothing (usually) in between. Default is 0.0. A value between 0.0 and 1.0 could be used for a rusty metal look. If metalness_map is also provided, both values are multiplied.
roughness (float) – How rough the material is. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. Default is 1.0. If roughness_map is also provided, both values are multiplied.
kwargs (Any) – Additional kwargs will be passed to the
base class
.
- property emissive
The emissive color of the mesh. I.e. the color that the object emits even when not lit by a light source. This color is added to the final color and unaffected by lighting. The alpha channel is ignored.
- property emissive_map
The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black. Note that both emissive color and emissive map are considered in srgb colorspace. Default None.
- property emissive_intensity
Intensity of the emissive light. Modulates the emissive color and emissive map. Default is 1.
Note that the intensity is applied in the physical colorspace. You can think of it as scaling the number of photons. Therefore using an intensity of 0.5 is not the same as halving the emissive color, which is in srgb space.
- property metalness
How much the material looks like a metal. Non-metallic materials such as wood or stone use 0.0, metal use 1.0, with nothing (usually) in between. Default is 0.0. A value between 0.0 and 1.0 could be used for a rusty metal look. If metalness_map is also provided, both values are multiplied.
- property metalness_map
The blue channel of this texture is used to alter the metalness of the material.
- property roughness
How rough the material is. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. Default is 1.0. If roughness_map is also provided, both values are multiplied.
- property roughness_map
The green channel of this texture is used to alter the roughness of the material.
- property normal_scale
How much the normal map affects the material. This 2-tuple is multiplied with the normal_map’s xy components (z is unaffected). Typical ranges are 0-1. Default is (1,1).
- property normal_map
The texture to create a normal map. Affects the surface normal for each pixel fragment and change the way the color is lit. Normal maps do not change the actual shape of the surface, only the lighting.
- property env_map
A texture that provides the environment map (in srgb colorspace). Default None.
This makes the surroundings of the object be reflected on its surface. The given texture should have its
generate_mipmaps
set to True. Otherwise the roughness has no effect (as if its always zero).
- property env_map_intensity
Scales the effect of the environment map by multiplying its color. Note that this scaling occurs in the physical color space.