# 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)

*** ** * ** ***


```
public final class KhronosPbrMaterial implements 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 methods |
|---|---|
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#close()()` Closes the `https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial` and releases its underlying graphics resources. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#create(androidx.xr.runtime.Session,androidx.xr.scenecore.AlphaMode)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/AlphaMode alphaMode)` Asynchronously creates a `https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial`. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setAlphaCutoff(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float alphaCutoff)` Sets the alpha cutoff threshold. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setBaseColorFactor(androidx.xr.runtime.math.Vector4)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector4 factor)` Sets a linear multiplier for the base color. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setBaseColorTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the material's base color texture (often called albedo). |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatFactor(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor)` Sets a scalar multiplier for the clearcoat layer's intensity. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatNormalTexture(androidx.xr.scenecore.Texture,kotlin.Float,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float scale, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the normal map texture for the clearcoat layer. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatRoughnessFactor(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor)` Sets a scalar multiplier for the clearcoat layer's roughness. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatRoughnessTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the clearcoat roughness texture. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setClearcoatTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the clearcoat intensity texture. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setEmissiveFactor(androidx.xr.runtime.math.Vector3)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 factor)` Sets a linear multiplier for the emissive color. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setEmissiveTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the emissive texture, defining light emitted by the material. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setMetallicFactor(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor)` Sets a scalar multiplier for the material's metallic property. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setMetallicRoughnessTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets a texture defining metallic and roughness properties. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setNormalTexture(androidx.xr.scenecore.Texture,kotlin.Float,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float scale, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the normal map texture for surface detail. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setOcclusionTexture(androidx.xr.scenecore.Texture,kotlin.Float,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float strength, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the ambient occlusion texture. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setRoughnessFactor(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor)` Sets a scalar multiplier for the material's roughness. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setSheenColorFactor(androidx.xr.runtime.math.Vector3)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 factor)` Sets a linear multiplier for the sheen color. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setSheenColorTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the sheen color texture, for materials like fabric. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setSheenRoughnessFactor(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor)` Sets a scalar multiplier for the sheen layer's roughness. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial#setSheenRoughnessTexture(androidx.xr.scenecore.Texture,androidx.xr.scenecore.TextureSampler)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler )` Sets the sheen roughness texture. |

## Public methods

### close

```
@MainThread
public void close()
```

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

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

### create

```
@MainThread
public static final @NonNull KhronosPbrMaterial create(@NonNull Session session, @NonNull AlphaMode alphaMode)
```

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

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

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

### setAlphaCutoff

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

```
@MainThread
public final void setAlphaCutoff(@FloatRange(from = 0.0, to = 1.0) float alphaCutoff)
```

Sets the alpha cutoff threshold.

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float alphaCutoff` | 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
public final void setBaseColorFactor(@NonNull Vector4 factor)
```

Sets a linear multiplier for the base color.

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector4 factor` | The `https://developer.android.com/reference/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
public final void setBaseColorTexture(
    @NonNull Texture texture,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used as the base color texture, in sRGB color space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setClearcoatFactor(@FloatRange(from = 0.0, to = 1.0) float factor)
```

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

Other methods for controlling the clearcoat layer include:

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

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

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

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor` | 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
public final void setClearcoatNormalTexture(
    @NonNull Texture texture,
    @FloatRange(from = 0.0) float scale,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used as the clearcoat normal texture, in tangent space and linear color. |
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float scale` | A scalar multiplier controlling the strength of the clearcoat normal. Default is 1.0. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setClearcoatRoughnessFactor(@FloatRange(from = 0.0, to = 1.0) float factor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor` | 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
public final void setClearcoatRoughnessTexture(
    @NonNull Texture texture,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used. It defines the clearcoat layer's roughness, using the green channel in linear space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setClearcoatTexture(
    @NonNull Texture texture,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used. The texture defines the clearcoat layer's strength, using the red channel in linear space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setEmissiveFactor(@NonNull Vector3 factor)
```

Sets a linear multiplier for the emissive color.

By default this is 0, 0, 0.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 factor` | The `https://developer.android.com/reference/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
public final void setEmissiveTexture(
    @NonNull Texture texture,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used as the emissive texture, in sRGB color space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setMetallicFactor(@FloatRange(from = 0.0, to = 1.0) float factor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor` | 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
public final void setMetallicRoughnessTexture(
    @NonNull Texture texture,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used. The texture must use its blue channel for metallic and green channel for roughness, in linear space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setNormalTexture(
    @NonNull Texture texture,
    @FloatRange(from = 0.0) float scale,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used as the normal map, in tangent space and linear color. |
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float scale` | A scalar multiplier controlling the strength of the normal map. Default is 1.0. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setOcclusionTexture(
    @NonNull Texture texture,
    @FloatRange(from = 0.0, to = 1.0) float strength,
    @NonNull TextureSampler sampler
)
```

Sets the ambient occlusion texture.

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used. It must use the red channel in linear space. |
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float strength` | A scalar multiplier controlling the strength of the occlusion. Default is 1.0. Valid values are between 0.0 and 1.0, inclusive. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setRoughnessFactor(@FloatRange(from = 0.0, to = 1.0) float factor)
```

Sets a scalar multiplier for the material's roughness.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor` | 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
public final void setSheenColorFactor(@NonNull Vector3 factor)
```

Sets a linear multiplier for the sheen color.

By default this is 0, 0, 0.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 factor` | The `https://developer.android.com/reference/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
public final void setSheenColorTexture(
    @NonNull Texture texture,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used, in sRGB. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/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
public final void setSheenRoughnessFactor(@FloatRange(from = 0.0, to = 1.0) float factor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float factor` | 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
public final void setSheenRoughnessTexture(
    @NonNull Texture texture,
    @NonNull TextureSampler sampler
)
```

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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Texture texture` | The `https://developer.android.com/reference/androidx/xr/scenecore/Texture` to be used. It defines the sheen layer's roughness, using the alpha channel in linear space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler sampler` | The `https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler` to be used when sampling the texture. |