pygfx.materials.PointsMaterial

class pygfx.materials.PointsMaterial(color=(1, 1, 1, 1), size=1, color_mode='auto', vertex_sizes=False, map=None, map_interpolation='linear', **kwargs)

Bases: Material

Point default material.

Renders (antialiased) disks of the given size and color.

Parameters:
  • color (Color) – The uniform color of the points (used depending on the color_mode).

  • size (int) – The size (diameter) of the points in screen space (px). Ignored if vertex_size is True.

  • color_mode (enum or str) – The mode by which the line is coloured. Default ‘auto’.

  • vertex_sizes (bool) – If True, use the vertex sizes provided in the geometry to set point sizes.

  • map (Texture) – The texture map specifying the color for each texture coordinate.

  • map_interpolation (str) – The method to interpolate the color map. Either ‘nearest’ or ‘linear’. Default ‘linear’.

  • kwargs (Any) – Additional kwargs will be passed to the material base class.

Examples

property color

The color of the points (if map is not set).

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.

  • auto: switch between uniform and vertex_map, depending on whether map is set.

  • uniform: use the material’s color property for the whole mesh.

  • vertex: use the geomerty colors buffer, one color per vertex.

  • vertex_map: use the geometry texcoords buffer to sample (per vertex) in the material’s map texture.

property size

The size (diameter) of the points, in logical pixels.

property vertex_sizes

Whether to use the vertex sizes provided in the geometry.

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 map_interpolation

The method to interpolate the colormap. Either ‘nearest’ or ‘linear’.