---
title: Load Textures
description: Add texture maps to your TresJS objects.
author: alvarosabu
thumbnail: /recipes/load-textures.png
difficulty: 1
---
# Load Textures
> All textures used in this example are from [ambientcg](https://ambientcg.com/).
Three-dimensional (3D) textures are images that contain multiple layers of data, allowing them to represent volume or simulate three-dimensional structures. These textures are commonly used in 3D graphics and visual effects to enhance the realism and complexity of scenes and objects.
There are two ways of loading 3D textures in TresJS:
## Using `useLoader`
The `useLoader` composable allows you to pass any type of three.js loader and a URL to load the resource from. It returns a `Promise` with the loaded resource.
For a detailed explanation of how to use `useLoader`, check out the [useLoader](/api/composables#use-loader) documentation.
```ts
import { useLoader } from '@tresjs/core'
import { TextureLoader } from 'three'
const { state: texture } = useLoader(TextureLoader, '/Rock035_2K_Color.jpg')
```
Then you can pass the texture to a material:
::: code-group
```vue [App.vue]
```
```vue [Model.vue]
```
:::
## Using `useTexture`
A more convenient way of loading textures is using the `useTexture` composable. It provides reactive state management and supports both single textures and arrays of textures.
To learn more about `useTexture`, check out the [useTexture](/api/composables#use-texture) documentation.
### Loading a Single Texture
```ts
import { useTexture } from '@tresjs/core'
const { state: texture, isLoading } = useTexture('/textures/black-rock/Rock035_2K_Color.jpg')
```
### Loading Multiple Textures
```ts
import { useTexture } from '@tresjs/core'
const [albedo, normal, roughness] = useTexture([
'/textures/black-rock/Rock035_2K_Color.jpg',
'/textures/black-rock/Rock035_2K_NormalDX.jpg',
'/textures/black-rock/Rock035_2K_Roughness.jpg'
])
```
Then you can use the textures in your material:
```vue
{{ albedo.isLoading.value ? 'Loading...' : 'Loaded' }}
```
### Reactive Texture Loading
The composable supports reactive paths, allowing you to change textures dynamically:
```ts
const texturePath = ref('/textures/black-rock/Rock035_2K_Color.jpg')
const { state: texture, isLoading } = useTexture(texturePath)
// Later, change the texture
texturePath.value = '/textures/hexagonal-rock/Rocks_Hexagons_002_basecolor.jpg'
```
### Using the UseTexture Component
For a more declarative approach, you can use the `UseTexture` component:
```vue
```