react-three-fiber-patterns

Build declarative 3D scenes in React using react-three-fiber, drei helpers, and custom shaders.

Updated May 16, 2026
One-click install
npx skills add https://github.com/organvm-i-theoria/_agent-ontology --skill react-three-fiber-patterns-organvm-i-theoria
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-three-fiber-patterns
Source: https://github.com/organvm-i-theoria/_agent-ontology/tree/main/.agents/skills/react-three-fiber-patterns
Command: npx skills add https://github.com/organvm-i-theoria/_agent-ontology --skill react-three-fiber-patterns-organvm-i-theoria

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three, @react-three/fiber, @react-three/drei, @types/three.

What problem does it solve? Writing Three.js scenes imperatively inside React leads to verbose boilerplate, manual lifecycle management, and hard-to-maintain rendering code. This Skill provides proven patterns for composing 3D scenes declaratively with react-three-fiber, so meshes, lights, cameras, and animations behave like ordinary React components. ## Core Features & Use Cases - Declarative Scene Composition: Set up Canvas, lighting, cameras, OrbitControls, and environments with JSX instead of imperative Three.js setup code. - Performance Patterns: Use InstancedMesh for thousands of particles, useFrame with delta time, and useMemo to avoid recreating geometry every render. - Animation & Shaders: Integrate react-spring or GSAP for animation, and write custom GLSL shader materials via drei's shaderMaterial helper. - Use Case: A developer building a product landing page wants an interactive rotating 3D model with floating particles and a distortion material. This Skill supplies the exact component patterns, drei helpers (Float, Sparkles, MeshDistortMaterial), and performance guidance to implement it. ## Quick Start Ask the AI to create a react-three-fiber scene with a spinning box, orbit controls, and a sunset environment using the patterns from this Skill.

Frequently Asked Questions about react-three-fiber-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a 3D scene in React with react-three-fiber?▼

Wrap your scene in the Canvas component from @react-three/fiber, then declare lights, meshes, and controls as JSX children. Add OrbitControls and Environment from @react-three/drei for camera interaction and image-based lighting.

How to animate objects in react-three-fiber?▼

Use the useFrame hook to mutate refs each frame with delta time for framerate-independent motion. For declarative animation, use @react-spring/three springs or drive mesh properties with GSAP timelines inside useEffect.

How do I render thousands of particles in react-three-fiber without lag?▼

Use InstancedMesh with a single geometry and material, updating each instance's matrix inside useFrame via a reusable Object3D dummy. This reduces draw calls by over 90 percent compared to rendering individual meshes.

Can I use custom GLSL shaders with react-three-fiber?▼

Yes. Create a shader material with drei's shaderMaterial helper, passing uniforms and vertex/fragment GLSL strings, then register it with extend. Update uniforms like uTime inside useFrame through a material ref.

What are common react-three-fiber performance mistakes?▼

Common mistakes include creating objects inside useFrame, mutating Three.js objects during render, loading models without Suspense, and skipping geometry disposal on unmount. Pre-create objects with useMemo or refs and always load assets asynchronously.