pygfx.resources.TextureMap

class pygfx.resources.TextureMap(texture, *, uv_channel=0, filter='linear', mag_filter=None, min_filter=None, mipmap_filter=None, wrap='repeat', wrap_s=None, wrap_t=None)

Bases: Trackable

A texture map.

TextureMap is used to define how a texture should be used in a material. including which uv channel to use, filtering, and wrapping

Parameters:
  • texture (Texture) – The texture to use for this map.

  • uv_channel (int, optional) – The uv channel of the texture to use. e.g. with channel=7, it will use the geometry.texcoords7. Default is 0, which uses the geometry.texcoords.

  • filter (str, optional) – The filter to use for magnification, minification znd mipmap, if not being set separately. Can be “nearest” or “linear”. Default is “linear”.

  • mag_filter (str, optional) – The magnification filter to use. Defaults to the value of filter.

  • min_filter (str, optional) – The minification filter to use. Defaults to the value of filter.

  • mipmap_filter (str, optional) – The mipmap filter to use. Defaults to the value of filter.

  • wrap (str, optional) – The wrap mode for both the s and t coordinates if not being set separately. Can be “clamp”, “repeat”, “mirror”. Default is “repeat”.

  • wrap_s (str, optional) – The wrap mode for the s coordinate. Defaults to the value of wrap.

  • wrap_t (str, optional) – The wrap mode for the t coordinate. Defaults to the value of wrap.

property texture

The texture to use for this map.

property uv_channel

The channel of the texture to use.

property mag_filter

The magnification filter to use.

property min_filter

The minification filter to use.

property mipmap_filter

The mipmap filter to use.

property wrap_s

The wrap mode for the s coordinate.

property wrap_t

The wrap mode for the t coordinate.

Examples

Ambient occlusion

Ambient occlusion

Clearcoat effect

Clearcoat effect

Colormap Image

Colormap Image

Lightmap

Lightmap

Line Segments

Line Segments

Mesh with quads

Mesh with quads

Subplots Video

Subplots Video

Synced Video Rendering

Synced Video Rendering

Minip Volume Rendering

Minip Volume Rendering

Volume Rendering 1

Volume Rendering 1

Image on Plane Geometry 1

Image on Plane Geometry 1

Validate Colormap

Validate Colormap

Mesh Colormaps

Mesh Colormaps

Mesh slice

Mesh slice