.claude/skills/r3f-textures/SKILL.md
React Three Fiber textures - useTexture, environment maps, video textures. Use when loading images, PBR texture sets, HDR environments, or video.
npx skillsauth add tadams95/kardashev-network r3f-texturesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
import { useTexture } from '@react-three/drei'
// Single texture
const texture = useTexture('/textures/wood.jpg')
// Multiple textures (array)
const [color, normal, roughness] = useTexture([
'/textures/color.jpg',
'/textures/normal.jpg',
'/textures/roughness.jpg',
])
// Named object (recommended for PBR)
const textures = useTexture({
map: '/textures/color.jpg',
normalMap: '/textures/normal.jpg',
roughnessMap: '/textures/roughness.jpg',
})
<meshStandardMaterial {...textures} />
import * as THREE from 'three'
const texture = useTexture('/textures/tile.jpg', (tex) => {
tex.wrapS = tex.wrapT = THREE.RepeatWrapping
tex.repeat.set(4, 4)
tex.colorSpace = THREE.SRGBColorSpace // For color maps
tex.anisotropy = 16
})
import { useEnvironment, Environment } from '@react-three/drei'
// As component
<Environment preset="sunset" background />
// As hook
const envMap = useEnvironment({ preset: 'sunset' })
<meshStandardMaterial envMap={envMap} metalness={1} roughness={0} />
// Custom HDR
const envMap = useEnvironment({ files: '/hdri/studio.hdr' })
import { useVideoTexture } from '@react-three/drei'
function VideoPlane() {
const texture = useVideoTexture('/videos/sample.mp4', {
start: true,
loop: true,
muted: true,
})
return (
<mesh>
<planeGeometry args={[16, 9].map(x => x * 0.5)} />
<meshBasicMaterial map={texture} toneMapped={false} />
</mesh>
)
}
function DynamicTexture() {
const textureRef = useRef()
useEffect(() => {
const canvas = document.createElement('canvas')
canvas.width = canvas.height = 256
const ctx = canvas.getContext('2d')
ctx.fillStyle = 'red'
ctx.fillRect(0, 0, 256, 256)
ctx.fillStyle = 'white'
ctx.font = '48px Arial'
ctx.fillText('Hello', 50, 150)
textureRef.current = new THREE.CanvasTexture(canvas)
}, [])
return (
<mesh>
<planeGeometry />
<meshBasicMaterial map={textureRef.current} />
</mesh>
)
}
import { useFBO } from '@react-three/drei'
function RenderToTexture() {
const fbo = useFBO(512, 512)
useFrame(({ gl, scene, camera }) => {
gl.setRenderTarget(fbo)
gl.render(scene, camera)
gl.setRenderTarget(null)
})
return (
<mesh>
<planeGeometry />
<meshBasicMaterial map={fbo.texture} />
</mesh>
)
}
// Preload at module level
useTexture.preload('/textures/hero.jpg')
useTexture.preload(['/tex1.jpg', '/tex2.jpg'])
<meshStandardMaterial
map={colorTexture} // sRGB
normalMap={normalTexture} // Linear
roughnessMap={roughTexture} // Linear
metalnessMap={metalTexture} // Linear
aoMap={aoTexture} // Linear, requires uv2
emissiveMap={emissiveTexture}
displacementMap={dispTexture}
displacementScale={0.1}
/>
development
Web3 integration with wagmi and viem - wallet connection, contract interactions, transactions, RainbowKit. Use when implementing wallet features, reading/writing contracts, or handling blockchain transactions.
content-media
Three.js textures - loading, configuration, UV mapping, environment maps. Use when loading images, configuring texture properties, or working with HDR environments.
data-ai
Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.
testing
Three.js post-processing - EffectComposer, bloom, depth of field, custom passes. Use when adding visual effects, screen-space effects, or enhancing rendered output.