# r3f-shaders

r3f-shaders — a coding-agent skill for custom GLSL and TSL shaders in React Three Fiber. It covers uniforms, vertex deformation, and shader debugging.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 2200 installs · ★ 138 repo stars
- Author: EnzeD
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/EnzeD/r3f-skills/tree/HEAD/skills/r3f-shaders/SKILL.md
- Updated: 2026-08-31
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/r3f-shaders

## What it does

The skill lays out two routes: GLSL materials for WebGL through `shaderMaterial`, and TSL for WebGPU. Before picking one, it tells the agent to check the installed Fiber, Drei, Three.js, and renderer versions, and to keep whatever the project already uses.

It walks through uniforms too. Drei materials expose accessors like `material.uTime`; a native `ShaderMaterial` wants `material.uniforms.uTime.value`. There is a note on coordinate spaces — normals, light directions, and view directions need to share one — plus color handling and the geometry density required for vertex deformation.

A warning sits around `onBeforeCompile`: it is only worth using when the built-in lighting matters. Shader chunk names shift between Three.js versions, so the skill pushes for a render test after upgrades.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-shaders -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/r3f-shaders/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/r3f-shaders/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-shaders -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/r3f-shaders/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-shaders -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/r3f-shaders/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install EnzeD/r3f-skills skills/r3f-shaders
```

2. **Manually: put the files in place**
- File: `.github/skills/r3f-shaders/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-shaders -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/EnzeD/r3f-skills --path skills/r3f-shaders
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/r3f-shaders/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-shaders -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/EnzeD/r3f-skills/tree/HEAD/skills/r3f-shaders/SKILL.md

## When to use it
- write a custom GLSL shader for a WebGL scene
- wire uniforms and animate them in `useFrame`
- sort out color spaces and tone mapping
- decide between `onBeforeCompile` and node materials
- avoid breaking the shader with backticks in the GLSL string

## Example prompts
- Make an animated wave material for a plane in my scene
- Add a uniform color and time to this GLSL shader
- Why doesn't my shader get lit or cast shadows?

## Similar
- [threejs-shaders](https://affpapa.org/en/nevibecode/skills/threejs-shaders.md) — skill · 22000 installs
- [pixijs-custom-rendering](https://affpapa.org/en/nevibecode/skills/pixijs-custom-rendering.md) — skill · 7000 installs
- [threejs](https://affpapa.org/en/nevibecode/skills/mrgoonie-threejs.md) — skill · 1300 installs
- [cloudai-threejs](https://affpapa.org/en/nevibecode/skills/cloudai-threejs.md) — skill · 207 installs
- [threejs-r3f](https://affpapa.org/en/nevibecode/skills/threejs-r3f.md) — skill · 1000 installs
- [godot-shaders](https://affpapa.org/en/nevibecode/skills/godot-shaders.md) — skill · 12700 installs

From the same set: [enzed/r3f-skills](https://affpapa.org/en/nevibecode/by/enzed/r3f-skills.md) — 11 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
