
R3f Shaders
Custom GLSL and TSL materials for React Three Fiber, with uniform handling and vertex deformation guidance.
- skills.sh installs
- 2.2K
- GitHub stars
- 138
- last updated
- Aug 21, 2026
What it does
- Covers custom shader materials in React Three Fiber, from
shaderMaterialand nativeShaderMaterialto patching built-in materials withonBeforeCompile - Includes an animated WebGL example, uniform update patterns, and notes on color space, tone mapping, and normal-space consistency
- Enforces that GLSL source avoids backticks and
${inside template literals, and that uniform-only changes skipneedsUpdate - Designed for developers writing shader code or debugging it in Fiber 9 projects, with WebGPU and TSL covered separately
Install
$ npx -y skills add enzed/r3f-skills --skill r3f-shaders -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React Three Fiber shaders
Select the shader path
Inspect installed Fiber, Drei, Three.js, and renderer versions first. The example uses Fiber 9 / React 19 and WebGL. Preserve an existing project's versions.
- Use built-in materials when their properties express the effect. For custom WebGL shading, use Drei
shaderMaterialor a native<shaderMaterial>. - WebGPU uses node materials and TSL; GLSL
ShaderMaterialandonBeforeCompileare not portable to it. Read WebGPU and TSL only when that renderer is relevant. - A shader is not automatically lit, shadowed, fogged, instanced, or skinned. Choose the required features before replacing a built-in material.
Animated WebGL material
Mount beneath Canvas. Keep the material class and extend call outside render; the local component avoids global JSX augmentation.
import { useRef } from 'react'
import { extend, useFrame } from '@react-three/fiber'
import { shaderMaterial } from '@react-three/drei'
import { Color } from 'three'
Details
- Repository
- github.com/enzed/r3f-skills
- Categories
- 3D, CAD & Modeling, Frontend & UI Code, Animation & Motion
- First seen
- May 16, 2026
More from enzed/r3f-skills
All 11Similar to R3f Shaders
More 3D, CAD & Modeling
threejs-shaderscloudai-x/threejs-skills22.2K installsCustom GLSL vertex and fragment shaders with uniforms, varyings, and TSL ports for WebGPU.
r3f-materialsenzed/r3f-skills2.2K installsChoosing React Three Fiber materials for PBR, transparency, and transmission, with shader guidance split out separately.
r3f-geometryenzed/r3f-skills2.2K installsReact Three Fiber geometry guide for built-in shapes, custom buffers, and instanced rendering, separate from material appearance.
react-native-r3fmindrally/skills695 installsExpert guidance for React Three Fiber scenes using React, Vite, Tailwind CSS, and Next UI conventions.
three-jsmindrally/skills854 installsExpert Three.js and React Three Fiber guidance covering modern React, TypeScript, and rendering performance.
threejs-materialscloudai-x/threejs-skills21.3K installsChoosing and tuning Three.js materials, from unlit basics through PBR, toon, and WebGPU node materials.