# KhronosPbrMaterial

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/KhronosPbrMaterial.kt+class:androidx.xr.scenecore.KhronosPbrMaterial) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class KhronosPbrMaterial : Material
```

<br />

*** ** * ** ***

Represents a lit PBR (Physically-Based Rendering) material, which defines the visual appearance of a surface by simulating its interaction with light.

This material implements the Khronos PBR (Physically-Based Rendering) metallic-roughness model. It is a direct implementation of the following glTF features:

- [Core glTF 2.0 Material](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-material) (pbrMetallicRoughness, normalTexture, occlusionTexture, emissiveTexture)

- [KHR_materials_clearcoat extension](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat)

- [KHR_materials_sheen extension](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen)

## Summary

| ### Public companion functions |
|---|---|
| `suspend https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#create(androidx.xr.runtime.Session,androidx.xr.scenecore.AlphaMode)(session: https://developer.android.com/reference/kotlin/androidx/xr/runtime/Session, alphaMode: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AlphaMode)` Asynchronously creates a `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial`. |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#close()()` Closes the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial` and releases its underlying graphics resources. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setAlphaCutoff(kotlin.Float)(alphaCutoff: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the alpha cutoff threshold. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setBaseColorFactor(androidx.xr.runtime.math.Vector4)(factor: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4)` Sets a linear multiplier for the base color. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setBaseColorTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)(texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler)` Sets the material's base color texture (often called albedo). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatFactor(kotlin.Float)(factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets a scalar multiplier for the clearcoat layer's intensity. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatNormalTexture(androidx.xr.scenecore.Texture,kotlin.Float,androidx.xr.scenecore.TextureSampler)( texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, scale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler )` Sets the normal map texture for the clearcoat layer. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatRoughnessFactor(kotlin.Float)(factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets a scalar multiplier for the clearcoat layer's roughness. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatRoughnessTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)(texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler)` Sets the clearcoat roughness texture. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)(texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler)` Sets the clearcoat intensity texture. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setEmissiveFactor(androidx.xr.runtime.math.Vector3)(factor: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Sets a linear multiplier for the emissive color. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setEmissiveTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)(texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler)` Sets the emissive texture, defining light emitted by the material. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setMetallicFactor(kotlin.Float)(factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets a scalar multiplier for the material's metallic property. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setMetallicRoughnessTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)(texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler)` Sets a texture defining metallic and roughness properties. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setNormalTexture(androidx.xr.scenecore.Texture,kotlin.Float,androidx.xr.scenecore.TextureSampler)( texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, scale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler )` Sets the normal map texture for surface detail. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setOcclusionTexture(androidx.xr.scenecore.Texture,kotlin.Float,androidx.xr.scenecore.TextureSampler)( texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, strength: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler )` Sets the ambient occlusion texture. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setRoughnessFactor(kotlin.Float)(factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets a scalar multiplier for the material's roughness. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setSheenColorFactor(androidx.xr.runtime.math.Vector3)(factor: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3)` Sets a linear multiplier for the sheen color. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setSheenColorTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)(texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler)` Sets the sheen color texture, for materials like fabric. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setSheenRoughnessFactor(kotlin.Float)(factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets a scalar multiplier for the sheen layer's roughness. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setSheenRoughnessTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)(texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture, sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler)` Sets the sheen roughness texture. |

## Public companion functions

### create

```
@MainThread
suspend fun create(session: Session, alphaMode: AlphaMode): KhronosPbrMaterial
```

Asynchronously creates a `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial`.

| Parameters |
|---|---|
| `session: https://developer.android.com/reference/kotlin/androidx/xr/runtime/Session` | The active `https://developer.android.com/reference/kotlin/androidx/xr/runtime/Session` in which to create the material. |
| `alphaMode: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AlphaMode` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AlphaMode` to use for the material. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial` | The newly created `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial`. |

## Public functions

### close

```
@MainThread
open fun close(): Unit
```

Closes the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial` and releases its underlying graphics resources.

After being closed, the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial` should not be used further.

### setAlphaCutoff

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

```
@MainThread
fun setAlphaCutoff(alphaCutoff: @FloatRange(from = 0.0, to = 1.0) Float): Unit
```

Sets the alpha cutoff threshold.

This value is only used when the material's `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#alphaMode()` is `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/AlphaMode#MASK()`.

| Parameters |
|---|---|
| `alphaCutoff: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The alpha cutoff. Fragments with alpha below this value are discarded. Default is 0.5. Valid values are between 0.0 and 1.0, inclusive. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the material's alphaMode is not ALPHA_MODE_MASK. |

### setBaseColorFactor

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

```
@MainThread
fun setBaseColorFactor(factor: Vector4): Unit
```

Sets a linear multiplier for the base color.

By default this is 1, 1, 1, 1.

| Parameters |
|---|---|
| `factor: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` | The `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector4` (RGBA) factor multiplied component-wise with the base color texture. |

### setBaseColorTexture

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

```
@MainThread
fun setBaseColorTexture(
    texture: Texture,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the material's base color texture (often called albedo).

This texture defines the main color of the surface. It is typically used to apply visual patterns like wood grain or fabric weaves. By default this is a white texture, where all pixels are 1, 1, 1, 1. In other words, if this is left as default, the base color will always be the base color factor.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used as the base color texture, in sRGB color space. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the base color texture. |

### setClearcoatFactor

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

```
@MainThread
fun setClearcoatFactor(factor: @FloatRange(from = 0.0, to = 1.0) Float): Unit
```

Sets a scalar multiplier for the clearcoat layer's intensity.

Other methods for controlling the clearcoat layer include:

- `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)`

- `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatNormalTexture(androidx.xr.scenecore.Texture,kotlin.Float,androidx.xr.scenecore.TextureSampler)`

- `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatRoughnessTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)`

- `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatRoughnessFactor(kotlin.Float)`

| Parameters |
|---|---|
| `factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The clearcoat intensity factor. Default is 0.0. Valid values are between 0.0 and 1.0, inclusive. |

### setClearcoatNormalTexture

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

```
@MainThread
fun setClearcoatNormalTexture(
    texture: Texture,
    scale: @FloatRange(from = 0.0) Float = 1.0f,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the normal map texture for the clearcoat layer.

By default the texture is unset, in which case no normal mapping is done for the clearcoat, even if the base color has normal mapping.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used as the clearcoat normal texture, in tangent space and linear color. |
| `scale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | A scalar multiplier controlling the strength of the clearcoat normal. Default is 1.0. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the texture. |

### setClearcoatRoughnessFactor

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

```
@MainThread
fun setClearcoatRoughnessFactor(factor: @FloatRange(from = 0.0, to = 1.0) Float): Unit
```

Sets a scalar multiplier for the clearcoat layer's roughness.

| Parameters |
|---|---|
| `factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The clearcoat roughness factor. Default is 0.0. Valid values are between 0.0 and 1.0, inclusive. |

### setClearcoatRoughnessTexture

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

```
@MainThread
fun setClearcoatRoughnessTexture(
    texture: Texture,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the clearcoat roughness texture.

By default this is a white texture, where all pixels are 1, 1, 1, 1. In other words, if this is left as default, the clearcoat roughness values will always come from the clearcoat roughness factor.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used. It defines the clearcoat layer's roughness, using the green channel in linear space. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the texture. |

### setClearcoatTexture

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

```
@MainThread
fun setClearcoatTexture(
    texture: Texture,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the clearcoat intensity texture.

By default this is a white texture, where all pixels are 1, 1, 1, 1. In other words, if this is left as default, the clearcoat intensity values will always come from the clearcoat factor.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used. The texture defines the clearcoat layer's strength, using the red channel in linear space. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the texture. |

### setEmissiveFactor

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

```
@MainThread
fun setEmissiveFactor(factor: Vector3): Unit
```

Sets a linear multiplier for the emissive color.

By default this is 0, 0, 0.

| Parameters |
|---|---|
| `factor: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | The `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` (in red, green, blue format) factor multiplied component-wise with the emissive texture. |

### setEmissiveTexture

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

```
@MainThread
fun setEmissiveTexture(
    texture: Texture,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the emissive texture, defining light emitted by the material.

By default this is a white texture, where all pixels are 1, 1, 1, 1. In other words, if this is left as default, the emissive values will always come from the emissive factor.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used as the emissive texture, in sRGB color space. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the emissive texture. |

### setMetallicFactor

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

```
@MainThread
fun setMetallicFactor(factor: @FloatRange(from = 0.0, to = 1.0) Float): Unit
```

Sets a scalar multiplier for the material's metallic property.

| Parameters |
|---|---|
| `factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The metallic factor. Default is 1.0. Valid values are between 0.0 and 1.0, inclusive. |

### setMetallicRoughnessTexture

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

```
@MainThread
fun setMetallicRoughnessTexture(
    texture: Texture,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets a texture defining metallic and roughness properties.

By default this is a white texture, where all pixels are 1, 1, 1, 1. In other words, if this is left as default, the metalic and roughness values will always come from the corresponding factors.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used. The texture must use its blue channel for metallic and green channel for roughness, in linear space. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the texture. |

### setNormalTexture

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

```
@MainThread
fun setNormalTexture(
    texture: Texture,
    scale: @FloatRange(from = 0.0) Float = 1.0f,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the normal map texture for surface detail.

A normal map is a texture that simulates fine surface details, such as bumps, grooves, or scratches, by modifying the way light reflects off the surface. This creates the illusion of depth and complexity. By default the texture is unset, in which case no normal mapping is done.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used as the normal map, in tangent space and linear color. |
| `scale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | A scalar multiplier controlling the strength of the normal map. Default is 1.0. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the normal texture. |

### setOcclusionTexture

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

```
@MainThread
fun setOcclusionTexture(
    texture: Texture,
    strength: @FloatRange(from = 0.0, to = 1.0) Float = 1.0f,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the ambient occlusion texture.

By default this is unset, in which case there is no ambient occlusion.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used. It must use the red channel in linear space. |
| `strength: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | A scalar multiplier controlling the strength of the occlusion. Default is 1.0. Valid values are between 0.0 and 1.0, inclusive. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the texture. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if strength is outside of the range 0-1, inclusive. |

### setRoughnessFactor

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

```
@MainThread
fun setRoughnessFactor(factor: @FloatRange(from = 0.0, to = 1.0) Float): Unit
```

Sets a scalar multiplier for the material's roughness.

| Parameters |
|---|---|
| `factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The roughness factor. Default is 1.0. Valid values are between 0.0 and 1.0, inclusive. |

### setSheenColorFactor

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

```
@MainThread
fun setSheenColorFactor(factor: Vector3): Unit
```

Sets a linear multiplier for the sheen color.

By default this is 0, 0, 0.

| Parameters |
|---|---|
| `factor: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | The `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` (RGB) factor multiplied component-wise with the sheen color texture. |

### setSheenColorTexture

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

```
@MainThread
fun setSheenColorTexture(
    texture: Texture,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the sheen color texture, for materials like fabric.

By default this is a white texture, where all pixels are 1, 1, 1, 1. In other words, if this is left as default, the sheen color values will always come from the sheen color factor.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used, in sRGB. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the texture. |

### setSheenRoughnessFactor

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

```
@MainThread
fun setSheenRoughnessFactor(factor: @FloatRange(from = 0.0, to = 1.0) Float): Unit
```

Sets a scalar multiplier for the sheen layer's roughness.

| Parameters |
|---|---|
| `factor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The sheen roughness factor. Default is 0.0. Valid values are between 0.0 and 1.0, inclusive. |

### setSheenRoughnessTexture

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

```
@MainThread
fun setSheenRoughnessTexture(
    texture: Texture,
    sampler: TextureSampler = TextureSampler()
): Unit
```

Sets the sheen roughness texture.

By default this is a white texture, where all pixels are 1, 1, 1, 1. In other words, if this is left as default, the sheen roughness values will always come from the sheen roughness factor.

| Parameters |
|---|---|
| `texture: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Texture` to be used. It defines the sheen layer's roughness, using the alpha channel in linear space. |
| `sampler: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler = TextureSampler()` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/TextureSampler` to be used when sampling the texture. |