Pmndrs.docs

useMatcapTexture

Loads matcap textures from this repository: https://github.com/emmelleppi/matcaps

(It is a fork of this repository: https://github.com/nidorx/matcaps)

const [matcap, url] = useMatcapTexture(
 0, // index of the matcap texture https://github.com/emmelleppi/matcaps/blob/master/matcap-list.json
 1024 // size of the texture ( 64, 128, 256, 512, 1024 )
)

return (
 ...
 <meshMatcapMaterial matcap={matcap} />
 ...
)

👉 You can also use the exact name of the matcap texture, like so:

const [matcap] = useMatcapTexture('3E2335_D36A1B_8E4A2E_2842A5')