TextureSampler


class TextureSampler


TextureSampler class used to define the way a texture gets sampled. The fields of this sampler are based on the public Filament TextureSampler class but may diverge over time. https://github.com/google/filament/blob/main/android/filament-android/src/main/java/com/google/android/filament/TextureSampler.java

Summary

Nested types

Comparison functions for the depth sampler.

Used for depth texture comparisons, determining how the sampled depth value is compared to a reference depth.

Specifies how the texture is sampled when it's magnified (appears larger than its original size).

Specifies how the texture is sampled when it's minified (appears smaller than its original size).

Defines how texture coordinates outside the range 0, 1 are handled.

Public companion functions

TextureSampler
create(
    minFilter: Int,
    magFilter: Int,
    wrapModeS: Int,
    wrapModeT: Int,
    wrapModeR: Int,
    compareMode: Int,
    compareFunc: Int,
    anisotropyLog2: Int
)

Public properties

Int

an Int which controls the level of anisotropic filtering applied to the texture.

Int

an Int which describes how depth texture sampling comparisons are evaluated.

Int

an Int which describes how depth texture sampling comparisons are handled.

Int

an Int which describes how neighboring texels are sampled when the rendered size is larger than the texture.

Int

an Int which describes how neighboring texels are sampled when the rendered size is smaller than the texture.

Int

an Int which describes how texture coordinates outside the 0-1 range are handled.

Int

an Int which describes how texture coordinates outside the 0-1 range are handled.

Int

an Int which describes how texture coordinates outside the 0-1 range are handled.

Public companion functions

create

Added in 1.0.0-alpha04
fun create(
    minFilter: Int = MinFilter.LINEAR,
    magFilter: Int = MagFilter.LINEAR,
    wrapModeS: Int = WrapMode.REPEAT,
    wrapModeT: Int = WrapMode.REPEAT,
    wrapModeR: Int = WrapMode.REPEAT,
    compareMode: Int = CompareMode.NONE,
    compareFunc: Int = CompareFunc.LE,
    anisotropyLog2: Int = 0
): TextureSampler

Public properties

anisotropyLog2

Added in 1.0.0-alpha04
val anisotropyLog2Int

an Int which controls the level of anisotropic filtering applied to the texture. Higher values mean more samples and better quality, at increased GPU cost.

compareFunc

Added in 1.0.0-alpha04
val compareFuncInt

an Int which describes how depth texture sampling comparisons are evaluated. Must be one of CompareFunc.

compareMode

Added in 1.0.0-alpha04
val compareModeInt

an Int which describes how depth texture sampling comparisons are handled. Must be one of CompareMode.

magFilter

Added in 1.0.0-alpha04
val magFilterInt

an Int which describes how neighboring texels are sampled when the rendered size is larger than the texture. Must be one of MagFilter.

minFilter

Added in 1.0.0-alpha04
val minFilterInt

an Int which describes how neighboring texels are sampled when the rendered size is smaller than the texture. Must be one of MinFilter.

wrapModeR

Added in 1.0.0-alpha04
val wrapModeRInt

an Int which describes how texture coordinates outside the 0-1 range are handled. Must be one of WrapMode

wrapModeS

Added in 1.0.0-alpha04
val wrapModeSInt

an Int which describes how texture coordinates outside the 0-1 range are handled. Must be one of WrapMode

wrapModeT

Added in 1.0.0-alpha04
val wrapModeTInt

an Int which describes how texture coordinates outside the 0-1 range are handled. Must be one of WrapMode