# TextureSampler

Artifact: [androidx.xr.scenecore:scenecore](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/TextureSampler.kt+class:androidx.xr.scenecore.TextureSampler) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class TextureSampler
```

<br />

*** ** * ** ***

Defines the sampling behavior for a texture.

The fields of this sampler are based on the public [Filament TextureSampler class](https://github.com/google/filament/blob/main/android/filament-android/src/main/java/com/google/android/filament/TextureSampler.java) but may diverge over time.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.MagnificationFilter` Defines the constants for texture magnification filters. |
| `class https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.MinificationFilter` Defines the constants for texture minification filters. |
| `class https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode` Defines the constants for texture wrap modes. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler#TextureSampler(androidx.xr.scenecore.TextureSampler.MinificationFilter,androidx.xr.scenecore.TextureSampler.MagnificationFilter,androidx.xr.scenecore.TextureSampler.WrapMode,androidx.xr.scenecore.TextureSampler.WrapMode,androidx.xr.scenecore.TextureSampler.WrapMode)( minificationFilter: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.MinificationFilter, magnificationFilter: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.MagnificationFilter, wrapModeHorizontal: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode, wrapModeVertical: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode, wrapModeDepth: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode )` Defines the sampling behavior for a texture. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.MagnificationFilter` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler#magnificationFilter()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is larger than the texture. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.MinificationFilter` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler#minificationFilter()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is smaller than the texture. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler#wrapModeDepth()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the depth axis. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler#wrapModeHorizontal()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the horizontal axis. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler#wrapModeVertical()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the vertical axis. |

## Public constructors

### TextureSampler

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
TextureSampler(
    minificationFilter: TextureSampler.MinificationFilter = MinificationFilter.LINEAR,
    magnificationFilter: TextureSampler.MagnificationFilter = MagnificationFilter.LINEAR,
    wrapModeHorizontal: TextureSampler.WrapMode = WrapMode.REPEAT,
    wrapModeVertical: TextureSampler.WrapMode = WrapMode.REPEAT,
    wrapModeDepth: TextureSampler.WrapMode = WrapMode.REPEAT
)
```

Defines the sampling behavior for a texture.

The fields of this sampler are based on the public [Filament TextureSampler class](https://github.com/google/filament/blob/main/android/filament-android/src/main/java/com/google/android/filament/TextureSampler.java) but may diverge over time.

| Parameters |
|---|---|
| `minificationFilter: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.MinificationFilter = MinificationFilter.LINEAR` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is smaller than the texture. |
| `magnificationFilter: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.MagnificationFilter = MagnificationFilter.LINEAR` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is larger than the texture. |
| `wrapModeHorizontal: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode = WrapMode.REPEAT` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the horizontal axis. |
| `wrapModeVertical: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode = WrapMode.REPEAT` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the vertical axis. |
| `wrapModeDepth: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler.WrapMode = WrapMode.REPEAT` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the depth axis. |

## Public properties

### magnificationFilter

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val magnificationFilter: TextureSampler.MagnificationFilter
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is larger than the texture.

### minificationFilter

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val minificationFilter: TextureSampler.MinificationFilter
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is smaller than the texture.

### wrapModeDepth

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val wrapModeDepth: TextureSampler.WrapMode
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the depth axis.

### wrapModeHorizontal

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val wrapModeHorizontal: TextureSampler.WrapMode
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the horizontal axis.

### wrapModeVertical

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val wrapModeVertical: TextureSampler.WrapMode
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the vertical axis.