
r3f-textures
Configure textures in React Three Fiber, including color spaces, UV channels, sampling, video, and render targets. Use for texture appearance or memory issues; use loader guidance for model-loading workflows.
- Installs
- 1.7K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/enzed/r3f-skills --skill r3f-textures- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads r3f-textures automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
React Three Fiber textures
Inspect installed Three.js, Fiber, Drei, and renderer versions first. Examples target Fiber 9 / React 19 and Three.js r185 with WebGL. Preserve correctly configured assets rather than resetting every texture.
Color versus data
| Texture content | Color-space annotation |
|---|---|
| PNG/JPEG base color or emissive color | SRGBColorSpace |
| Roughness, metalness, normal, AO, alpha/masks | NoColorSpace |
| Linear HDR/EXR lighting data | Preserve loader-provided linear metadata |
NoColorSpace is not another name for LinearSRGBColorSpace: scalar/vector data has no color space. Do not blanket-convert every map to sRGB.
Load a color map
Mount under Suspense inside Canvas. The file path is an application asset, not a file provided by this skill.
import { useTexture } from '@react-three/drei'
import { SRGBColorSpace } from 'three'
export default function Example() {
const map = useTexture('/textures/checker.png', (texture) => {
// This URL is consistently used as a color texture by all consumers.
texture.colorSpace = SRGBColorSpace
texture.needsUpdate = true
})
return (
<mesh>
<planeGeometry args={[3, 3]} />
<meshStandardMaterial map={map} roughness={1} />
</mesh>
)
}
Fiber handles common built-in color map props, and glTF loaders set texture metadata. Explicit annotation is especially important for custom shader uniforms or manually created textures.
Cache and ownership
useTexture/useLoadercache by loader and URL inputs. The same source can return the same Texture object. Repeat, offset, wrapping, filters, and colorSpace changes can affect every consumer.- Clone the Texture object before per-instance configuration. Reuse the underlying image where possible; separately dispose only the clone you own. Do not dispose the cached source from an individual consumer.
- Do not clear a loader cache during render. Cache eviction and GPU disposal are separate operations and require knowing that no active consumer still needs the resource.
- Avoid replacing the uniform/texture object every frame; update offsets or owned values directly. On a demand loop, invalidate after imperative changes.
UVs and sampling
texture.channel = 0selectsuv, 1 selectsuv1, thenuv2anduv3. Choose the actual geometry attribute; AO/light maps no longer universally require copyinguvintouv2.- Repeat outside [0, 1] requires RepeatWrapping or MirroredRepeatWrapping. Offset/repeat/rotation are texture transforms; atlas animations generally do not need React state per frame.
- Wrapping, color-space, and upload configuration changes may need
texture.needsUpdate. Offset/repeat changes use the texture matrix and do not normally require re-uploading image data. - For pixel art, use nearest filtering deliberately. For minified surfaces, mipmaps reduce shimmer; cap anisotropy to the renderer's supported maximum and the scene's needs.
- Power-of-two dimensions are not a universal WebGL2 requirement. Size textures for screen coverage, memory, compression-format constraints, and quality rather than an obsolete blanket rule.
- Download size is not GPU memory size. Consider KTX2/Basis where supported; configure renderer capability detection and host decoder/transcoder assets deliberately.
- For a replacement glTF color map, match the model's UV/orientation conventions; a manually loaded texture commonly needs
flipY=false. Do not flip already configured glTF maps again.
Specialized textures
- Prefer
useVideoTexturewhen its lifecycle fits. Check autoplay/muting, CORS, user gestures, and source cleanup; changing video resolution may require a new texture. Do not promise autoplay succeeds on every browser. - Canvas/DataTexture content changes need
needsUpdate; data textures should keep data color-space semantics. Creating a texture in a frame loop leaks work/resources unless deliberately managed. - For render targets, read offscreen rendering. Never sample from a texture while rendering into that same target.
- Keep environment maps on a lighting path (
Environment/useEnvironment) rather than assigning a regular 2D image without a suitable mapping/PMREM workflow.
Verify
Test a known color swatch, data maps under changing lights, texture orientation, repeated mounts, and two consumers with different UV transforms. Inspect GPU texture counts; they are counts, not byte-accurate memory measurements.
Sources
FAQ
What does the r3f-textures skill do?
Configure textures in React Three Fiber, including color spaces, UV channels, sampling, video, and render targets. Use for texture appearance or memory issues; use loader guidance for model-loading workflows.
How do I install r3f-textures?
Run npx skills add https://github.com/enzed/r3f-skills --skill r3f-textures in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/r3f-textures/ (personal) or .claude/skills/r3f-textures/ (project).
Which AI agents can use r3f-textures?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is r3f-textures safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains r3f-textures?
It is published by enzed in enzed/r3f-skills. It has 1,748 recorded installs.
More from enzed/r3f-skills
r3f-interaction
enzed/r3f-skills
Implement React Three Fiber pointer events, picking, dragging, keyboard input, and camera controls. Use for scene interaction and event propagation, rather than animation or physics simulation itself.
r3f-fundamentals
enzed/r3f-skills
Set up React Three Fiber scenes, Canvas, typed JSX, hooks, and resource ownership. Use for scene architecture and render-loop setup, rather than detailed materials or effects.
r3f-animation
enzed/r3f-skills
Animate React Three Fiber objects with useFrame, damping, and GLTF clips. Use for procedural motion, animation transitions, or demand-loop animation; use physics guidance for collision-driven movement.
r3f-postprocessing
enzed/r3f-skills
Configure React Three Fiber postprocessing, bloom, selection effects, ambient occlusion, and depth of field. Use for composer pipelines and screen-space effects, rather than mesh material shaders.
r3f-materials
enzed/r3f-skills
Choose and configure React Three Fiber surface materials, PBR, transparency, and transmission. Use for mesh appearance and material cost; use shader guidance for custom GLSL or TSL code.
r3f-geometry
enzed/r3f-skills
Build React Three Fiber geometry, custom buffers, instanced meshes, points, and lines. Use for shape construction and geometry draw-call optimization, rather than material appearance.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.