pygfx.materials.PointsMaterial
- class pygfx.materials.PointsMaterial(size=4, size_space='screen', size_mode='uniform', *, color=(1, 1, 1, 1), color_mode='auto', edge_mode='centered', map=None, maprange=None, aa=False, rotation=0, rotation_mode='uniform', **kwargs)
Bases:
MaterialPoint default material.
Renders disks of the given size and color.
- Parameters:
size (float) – The size (diameter) of the points in logical pixels. Default 4.
size_space (str | CoordSpace) – The coordinate space in which the size is expressed (‘screen’, ‘world’, ‘model’). Default ‘screen’.
size_mode (str | SizeMode) – The mode by which the points are sized. Default ‘uniform’.
color (str | tuple | Color) – The uniform color of the points (used depending on the
color_mode).color_mode (str | ColorMode) – The mode by which the points are coloured. Default ‘auto’.
edge_mode (str | EdgeMode) – The mode by which the points are edged. Default ‘centered’.
map (TextureMap | Texture) – The texture map specifying the color for each texture coordinate.
maprange (tuple) – The range of the
geometry.texcoordsthat is projected onto the (color) map. Default (0, 1).aa (bool) – Whether the points are anti-aliased in the shader. Default False.
rotation (float) – The rotation of the point marker in radians. Default 0.
rotation_mode (str | RotationMode) – The mode by which the points are rotated. Default ‘uniform’.
kwargs (Any) – Additional kwargs will be passed to the
material base class.
- property color
The color of the points (if map is not set).
- property aa
Whether the point’s visual edge is anti-aliased.
Aliasing gives prettier results by producing semi-transparent fragments at the edges. Lines thinner than one physical pixel are also diminished by making them more transparent.
However, because semi-transparent fragments are introduced, artifacts may occur if certain cases. For the same reason, aa only works for the “blended” and “weighted” alpha methods.
Note that by default, pygfx already uses SSAA and/or PPAA to anti-alias the total renderered result. Point-based aa is an additional visual improvement.
- property color_mode
The way that color is applied to the points.
- property edge_mode
The way that edges are applied to the mesh.
- property size
The size (diameter) of the points, in logical pixels (or world/model space if
size_spaceis set).
- property size_space
The coordinate space in which the size is expressed.
- property size_mode
The way that size 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.
- property maprange
The range of the
geometry.texcoordsthat is projected onto the (color) map.By default this value is (0.0, 1.0), but if the
texcoordsrepresents some domain-specific value, e.g. temperature, thenmaprangecan be set to e.g. (0, 100).
- property rotation
The rotation of the marker in radians.
- property rotation_mode
The way that rotation is applied to the markers.