pygfx.materials.MeshAbstractMaterial
- class pygfx.materials.MeshAbstractMaterial(color='#fff', color_mode='auto', map=None, map_interpolation='linear', side='both', **kwargs)
Bases:
Material
Abstract mesh material.
The abstract parent class for all mesh materials, defining their common properties.
- Parameters:
color (Color) – The uniform color of the mesh (used depending on the
color_mode
).color_mode (str | ColorMode) – The mode by which the mesh is coloured. Default ‘auto’.
map (Texture) – The texture map specifying the color at each texture coordinate. Optional.
map_interpolation (str) – The method to interpolate the color map. Either ‘nearest’ or ‘linear’. Default ‘linear’.
side (str | VisibleSide) – What side of the mesh is visible. Default “both”.
kwargs (Any) – Additional kwargs will be passed to the
material base class
.
Notes
The color format of the map is assumed to be sRGB. To use physical space instead, set the texture’s colorspace property to “physical”. To learn more about this, check out the colorspace documentation
The direction of a face is determined using Counter-clockwise (CCW) winding; i.e., if the fingers of your curled hand match the direction in which the face’s vertices are defined then your thumb points into the “front” direction of the face. If this is not the case for your mesh, adjust its geometry (using e.g.
np.fliplr()
ongeometry.indices
).- property color
The uniform color of the mesh. This value is ignored if a texture map is used.
- property color_is_transparent
Whether the color is (semi) transparent (i.e. not fully opaque).
- property color_mode
The way that color is applied to the mesh.
- property map
The texture map specifying the color for each texture coordinate. The dimensionality of the map can be 1D, 2D or 3D, but should match the number of columns in the geometry’s texcoords.
The colors in the map are assumed to be in sRGB space. To use physical space instead, set the texture’s colorspace property to “physical”.
- property map_interpolation
The method to interpolate the colormap. Either ‘nearest’ or ‘linear’.
- property side
Defines which side of faces will be rendered.
See
pygfx.utils.enums.VisibleSide
:Which side of the mesh is the front is determined by the winding of the faces. Counter-clockwise (CCW) winding is assumed. If this is not the case, adjust your geometry (using e.g.
np.fliplr()
ongeometry.indices
).