glodrei
Version:
useful add-ons for react-three-fiber
24 lines (18 loc) • 502 B
text/mdx
title: Texture / useTexture
sourcecode: src/core/Texture.tsx
[](https://drei.pmnd.rs/?path=/story/loaders-texture)
A convenience hook that uses `useLoader` and `TextureLoader`
```jsx
const texture = useTexture(url)
const [texture1, texture2] = useTexture([texture1, texture2])
```
You can also use key: url objects:
```jsx
const props = useTexture({
metalnessMap: url1,
map: url2,
})
return <meshStandardMaterial {...props} />
```