TextureSampler

TextureSampler defines how a texture is accessed during rendering.

It specifies filtering modes, wrapping modes, and optional comparison modes for texture sampling. MaterialInstance copies it when binding a texture, so later changes don't affect bound textures.

Constructors

Link copied to clipboard
constructor()

Creates a TextureSampler with the default parameters: NEAREST filtering, CLAMP_TO_EDGE on all axes, anisotropy 1, no comparison.

constructor(minMag: TextureSampler.MagFilter, str: TextureSampler.WrapMode = WrapMode.CLAMP_TO_EDGE)

Creates a TextureSampler with the same minification and magnification filter and one wrap mode for all axes.

constructor(min: TextureSampler.MinFilter, mag: TextureSampler.MagFilter, str: TextureSampler.WrapMode = WrapMode.CLAMP_TO_EDGE)

Creates a TextureSampler with separate minification and magnification filters, and a wrap mode applied to all axes.

Creates a TextureSampler with separate filters and wrap modes for each axis.

constructor(mode: TextureSampler.CompareMode, func: TextureSampler.CompareFunc = CompareFunc.LE)

Creates a TextureSampler with default filtering and wrapping, and the given comparison mode.

Types

Link copied to clipboard

Comparison function for depth and stencil tests, and for COMPARE_TO_TEXTURE sampling.

Link copied to clipboard

Compare mode for shadow map sampling and similar depth comparisons.

Link copied to clipboard

Magnification filter specifies how texels are filtered when the texture is sampled at a size larger than its original resolution.

Link copied to clipboard

Minification filter specifies how texels are filtered when the texture is sampled at a size smaller than its original resolution.

Link copied to clipboard

Texture wrapping mode for texture coordinates outside the 0..1 range.

Properties

Link copied to clipboard

Anisotropic filtering amount. Should be a power-of-two. Default is 1.0 (disabled). The maximum permissible value is 128.

Link copied to clipboard

Comparison function for depth comparisons.

Link copied to clipboard
Link copied to clipboard

Magnification filter.

Link copied to clipboard

Minification filter.

Link copied to clipboard

Wrap mode for R (depth) texture coordinate.

Link copied to clipboard

Wrap mode for S (horizontal) texture coordinate.

Link copied to clipboard

Wrap mode for T (vertical) texture coordinate.

Functions

Link copied to clipboard

Sets the comparison mode and function.