Aller au contenu

SamplerDescriptor

data class SamplerDescriptor(
    val addressModeU: GPUAddressMode = GPUAddressMode.ClampToEdge, 
    val addressModeV: GPUAddressMode = GPUAddressMode.ClampToEdge, 
    val addressModeW: GPUAddressMode = GPUAddressMode.ClampToEdge, 
    val magFilter: GPUFilterMode = GPUFilterMode.Nearest, 
    val minFilter: GPUFilterMode = GPUFilterMode.Nearest, 
    val mipmapFilter: GPUMipmapFilterMode = GPUMipmapFilterMode.Nearest, 
    val lodMinClamp: Float = 0.0f, 
    val lodMaxClamp: Float = 32.0f, 
    val compare: GPUCompareFunction? = null, 
    val maxAnisotropy: UShort, 
    val label: String = ""
) : GPUSamplerDescriptor
Describes the address modes, filtering modes, and level-of-detail limits for a GPUSampler.

Constructors

SamplerDescriptor

constructor(
    addressModeU: GPUAddressMode = GPUAddressMode.ClampToEdge, 
    addressModeV: GPUAddressMode = GPUAddressMode.ClampToEdge, 
    addressModeW: GPUAddressMode = GPUAddressMode.ClampToEdge, 
    magFilter: GPUFilterMode = GPUFilterMode.Nearest, 
    minFilter: GPUFilterMode = GPUFilterMode.Nearest, 
    mipmapFilter: GPUMipmapFilterMode = GPUMipmapFilterMode.Nearest, 
    lodMinClamp: Float = 0.0f, 
    lodMaxClamp: Float = 32.0f, 
    compare: GPUCompareFunction? = null, 
    maxAnisotropy: UShort, 
    label: String = ""
)

Properties

addressModeU

open override val addressModeU: GPUAddressMode
Specifies the address modes for the texture width, height, and depth coordinates, respectively.

addressModeV

open override val addressModeV: GPUAddressMode
Specifies the address modes for the texture width, height, and depth coordinates, respectively.

addressModeW

open override val addressModeW: GPUAddressMode
Specifies the address modes for the texture width, height, and depth coordinates, respectively.

compare

open override val compare: GPUCompareFunction?
When provided the sampler will be a comparison sampler with the specified GPUCompareFunction. Note: Comparison samplers may use filtering, but the sampling results will be implementation-dependent and may differ from the normal filtering rules.

label

open override val label: String

lodMaxClamp

open override val lodMaxClamp: Float
Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture.

lodMinClamp

open override val lodMinClamp: Float
Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture.

magFilter

open override val magFilter: GPUFilterMode
Specifies the sampling behavior when the sampled area is smaller than or equal to one texel.

maxAnisotropy

open override val maxAnisotropy: UShort
Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is enabled when maxAnisotropy is > 1 and the implementation supports it. Anisotropic filtering improves the image quality of textures sampled at oblique viewing angles. Higher maxAnisotropy values indicate the maximum ratio of anisotropy supported when filtering.

minFilter

open override val minFilter: GPUFilterMode
Specifies the sampling behavior when the sampled area is larger than one texel.

mipmapFilter

open override val mipmapFilter: GPUMipmapFilterMode
Specifies behavior for sampling between mipmap levels.