# Material

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

*** ** * ** ***


```
public interface Material extends AutoCloseable
```

<br />

Known direct subclasses [KhronosPbrMaterial](https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial), [KhronosUnlitMaterial](https://developer.android.com/reference/androidx/xr/scenecore/KhronosUnlitMaterial)

|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/KhronosPbrMaterial` | Represents a lit PBR (Physically-Based Rendering) material, which defines the visual appearance of a surface by simulating its interaction with light. |
| `https://developer.android.com/reference/androidx/xr/scenecore/KhronosUnlitMaterial` | Represents an unlit material, which is not affected by scene lighting. |

*** ** * ** ***

Represents a `https://developer.android.com/reference/androidx/xr/scenecore/Material` in SceneCore.

A `https://developer.android.com/reference/androidx/xr/scenecore/Material` defines the visual appearance of a surface when rendered. It encapsulates properties like color, texture, and how light interacts with the surface.

It's important to close a `https://developer.android.com/reference/androidx/xr/scenecore/Material` when it's no longer needed to free up resources. This can be done by calling the `https://developer.android.com/reference/androidx/xr/scenecore/Material#close()` method or letting it get garbage collected.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/xr/scenecore/Material#close()()` Closes the given `https://developer.android.com/reference/androidx/xr/scenecore/Material`. |

## Public methods

### close

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

```
@MainThread
abstract void close()
```

Closes the given `https://developer.android.com/reference/androidx/xr/scenecore/Material`.

The `https://developer.android.com/reference/androidx/xr/scenecore/Material` can be explicitly closed at anytime or garbage collected. In both cases, its resources are freed.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the material has already been closed. |