TextureSampler


public final 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

public static class TextureSampler.CompareFunc

Comparison functions for the depth sampler.

public static class TextureSampler.CompareMode

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

public static class TextureSampler.MagFilter

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

public static class TextureSampler.MinFilter

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

public static class TextureSampler.WrapMode

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

Public methods

static final @NonNull TextureSampler
create(
    int minFilter,
    int magFilter,
    int wrapModeS,
    int wrapModeT,
    int wrapModeR,
    int compareMode,
    int compareFunc,
    int anisotropyLog2
)
final int

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

final int

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

final int

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

final int

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

final int

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

final int

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

final int

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

final int

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

Public methods

create

Added in 1.0.0-alpha04
public static final @NonNull TextureSampler create(
    int minFilter,
    int magFilter,
    int wrapModeS,
    int wrapModeT,
    int wrapModeR,
    int compareMode,
    int compareFunc,
    int anisotropyLog2
)

getAnisotropyLog2

Added in 1.0.0-alpha04
public final int getAnisotropyLog2()

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.

getCompareFunc

Added in 1.0.0-alpha04
public final int getCompareFunc()

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

getCompareMode

Added in 1.0.0-alpha04
public final int getCompareMode()

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

getMagFilter

Added in 1.0.0-alpha04
public final int getMagFilter()

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

getMinFilter

Added in 1.0.0-alpha04
public final int getMinFilter()

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

getWrapModeR

Added in 1.0.0-alpha04
public final int getWrapModeR()

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

getWrapModeS

Added in 1.0.0-alpha04
public final int getWrapModeS()

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

getWrapModeT

Added in 1.0.0-alpha04
public final int getWrapModeT()

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