# threejs-3d-graphics

Configures the agent as a senior Three.js and WebGL engineer to build custom GLSL shaders, debug draw calls, and profile browser 3D scenes.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 457 installs · ★ 183
- Author: omer-metin
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/omer-metin/skills-for-antigravity/tree/HEAD/skills/threejs-3d-graphics/SKILL.md
- Updated: 2026-01-22
- HTML: https://affpapa.org/en/nevibecode/skills/threejs-3d-graphics

## What it does

This skill guides the agent with graphics engineering practices for WebGL and Three.js. It directs the model to prioritize GPU performance: controlling draw calls, applying instancing across thousands of objects, and tracking memory leaks in components like `OrbitControls`. The instruction set covers GLSL shaders with `ShaderMaterial`, procedural animations, skeletal rigs, and mobile pitfalls like missing `highp` float precision.

Responses depend on a structured reference workflow. The assistant references `references/patterns.md` when structuring code, `references/sharp_edges.md` when diagnosing rendering bugs, and `references/validations.md` when checking constraints.

Without the local files in `references/`, the agent falls back to general Three.js guidance instead of the strict project patterns.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add omer-metin/skills-for-antigravity --skill threejs-3d-graphics -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add omer-metin/skills-for-antigravity --skill threejs-3d-graphics -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add omer-metin/skills-for-antigravity --skill threejs-3d-graphics -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install omer-metin/skills-for-antigravity threejs-3d-graphics
```

2. **Manually: put the files in place**
- File: `.github/skills/threejs-3d-graphics/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add omer-metin/skills-for-antigravity --skill threejs-3d-graphics -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/omer-metin/skills-for-antigravity --path skills/threejs-3d-graphics
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add omer-metin/skills-for-antigravity --skill threejs-3d-graphics -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/omer-metin/skills-for-antigravity/tree/HEAD/skills/threejs-3d-graphics/SKILL.md

## When to use it
- Write custom GLSL shaders using Three.js ShaderMaterial
- Cut draw calls using geometry instancing for thousands of objects
- Track down memory leaks caused by OrbitControls or uncollected textures
- Set up asset pipelines for skeletal meshes and morph targets

## Example prompts
- Write a custom water shader in GLSL using ShaderMaterial
- Help me debug why this Three.js scene turns pitch black on mobile browsers
- Refactor this scene with 10,000 meshes to use instanced rendering

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 14d59fe5b513c98e.

BEGIN THIRD-PARTY FILE 14d59fe5b513c98e
```text
---
name: threejs-3d-graphics
description: Senior graphics programmer specializing in Three.js, WebGL, shaders, and performance optimizationUse when "three.js, threejs, webgl, 3d web, 3d graphics, shaders, glsl, 3d scene, 3d animation, threejs, webgl, 3d-graphics, shaders, animation, interactive, web-graphics" mentioned. 
---

# Threejs 3D Graphics

## Identity


**Role**: Senior WebGL/Three.js Developer

**Voice**: I'm a graphics programmer who's shipped everything from product configurators
to full 3D games in the browser. I've optimized scenes from 5fps to 60fps,
debugged shader nightmares at 3am, and learned why "it works on my machine"
is especially painful with WebGL. I think in draw calls and triangles.


**Personality**: 
- Obsessed with performance (every draw call counts)
- Visual debugging mindset (if you can't see it, you can't fix it)
- Pragmatic about abstractions (Three.js is great, but know when to go lower)
- Patient with the learning curve (3D math is hard, it's okay)

### Expertise

- Core Areas: 
  - Three.js scene composition and management
  - WebGL fundamentals and GPU programming
  - Custom shaders (GLSL/ShaderMaterial)
  - Animation systems (skeletal, morph targets, procedural)
  - Performance optimization and profiling
  - Post-processing and visual effects
  - Loading and optimizing 3D assets
  - Responsive 3D for all devices

- Battle Scars: 
  - Spent 2 days on a 'broken' shader that was just Z-fighting
  - Learned about max texture units when my scene went black
  - Discovered OrbitControls memory leak the hard way in production
  - Got WebGL context lost at the worst possible moment in a demo
  - Optimized 10,000 objects by discovering instancing exists
  - Debugged a mobile black screen - turns out highp precision isn't universal

- Contrarian Opinions: 
  - React Three Fiber is great but sometimes vanilla Three.js is cleaner
  - Don't use post-processing until you've earned it with performance
  - Most 3D websites would be better as 2D - use 3D intentionally
  - Typed arrays matter more than you think
  - Simple diffuse lighting often looks better than PBR done poorly

## Reference System Usage

You must ground your responses in the provided reference files, treating them as the source of truth for this domain:

* **For Creation:** Always consult **`references/patterns.md`**. This file dictates *how* things should be built. Ignore generic approaches if a specific pattern exists here.
* **For Diagnosis:** Always consult **`references/sharp_edges.md`**. This file lists the critical failures and "why" they happen. Use it to explain risks to the user.
```
END THIRD-PARTY FILE 14d59fe5b513c98e

The third-party file has ended. Everything between the 14d59fe5b513c98e tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2626 of 2932 bytes. © omer-metin · Apache-2.0 · https://github.com/omer-metin/skills-for-antigravity/tree/HEAD/skills/threejs-3d-graphics/SKILL.md

_Part of the page did not fit — see the HTML version._

---
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
