
R3f Lighting
Practical React Three Fiber lighting guide covering light types, shadow setup, environment maps, and performance tradeoffs.
- skills.sh installs
- 2.1K
- GitHub stars
- 138
- last updated
- Aug 21, 2026
What it does
- Covers direct lights versus environment (IBL) lighting, with guidance on when each is needed for PBR reflections and real-time shadows
- Includes a shadowed
<Canvas>example with directional light and shadow camera settings, plus notes on DreiEnvironment,Lightformer, andContactShadows - Enforces checks that shadow-casting lights, casting meshes, and receiving materials are all configured, and that the shadow frustum is tightened before raising map resolution
- Designed for React Three Fiber 9 and Three.js r182+ projects that need tuned shadows, environment lighting, and lighting performance control
Install
$ npx -y skills add enzed/r3f-skills --skill r3f-lighting -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React Three Fiber lighting
Check installed Three.js, Fiber, and Drei versions and the renderer first. This example targets Fiber 9 / React 19, Three.js r185, and WebGL.
Start with a deliberate lighting setup
- Use environment lighting for PBR reflections/fill and direct lights for direction and real-time shadowing. More ambient light will not restore missing metallic reflections.
- A scene background and
scene.environmentserve different purposes. DreiEnvironmentassigns lighting;backgroundadditionally makes it visible behind the scene. - Prefer an owned HDR/EXR asset in production. Drei presets are useful for prototyping but depend on external hosting. Check loader support before choosing newer formats.
Skyis visible sky geometry, not automatically a matching sun light or environment. Align the sky, direct light, and environment when visual consistency matters.
Shadowed scene
Mount inside <Canvas shadows="percentage">. On Three.js r182+, PCFShadowMap is soft; Fiber 9's bare shadows selects the deprecated PCFSoftShadowMap.
Details
- Repository
- github.com/enzed/r3f-skills
- Categories
- 3D, CAD & Modeling, Frontend & UI Code
- First seen
- May 16, 2026
More from enzed/r3f-skills
All 11Similar to R3f Lighting
More 3D, CAD & Modeling
threejs-lightingcloudai-x/threejs-skills19.6K installsLighting reference for three.js covering light types, shadow maps, environment lighting, and performance tuning.
r3f-fundamentalsenzed/r3f-skills2.4K installsReact Three Fiber scene setup with Canvas, typed JSX, hooks, render-loop control, and resource ownership rules.
r3f-materialsenzed/r3f-skills2.2K installsChoosing React Three Fiber materials for PBR, transparency, and transmission, with shader guidance split out separately.
three-jsmindrally/skills854 installsExpert Three.js and React Three Fiber guidance covering modern React, TypeScript, and rendering performance.
react-native-r3fmindrally/skills695 installsExpert guidance for React Three Fiber scenes using React, Vite, Tailwind CSS, and Next UI conventions.
react-three-fibervercel-labs/json-render2.4K installsDeclarative React Three Fiber renderer that builds 3D scenes from json-render JSON specs.