# particles-gpu

particles-gpu generates GPU-accelerated particle systems for Three.js and React Three Fiber. Ideal for rendering thousands to millions of points smoothly.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 173 installs · ★ 9 repo stars
- Author: Bbeierle12
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/Bbeierle12/Skill-MCP-Claude/tree/HEAD/skills/particles-gpu/SKILL.md
- Updated: 2026-10-25
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/particles-gpu

## What it does

This skill guides the agent in building GPU-driven visual effects using WebGL. It supplies patterns for `@react-three/fiber` and plain Three.js, covering `Points` geometry, custom `bufferAttribute` setups, and custom GLSL shaders.

The reference divides setups by complexity and scale. Standard `Points` geometry handles simple point sprites from 10k up to 500k particles. Instanced meshes cover 3D geometry particles up to 100k, while custom vertex and fragment shaders push counts up to 10 million with per-point size attenuation and circular discard logic.

All provided examples rely on `three` alongside `@react-three/fiber`, so having these dependencies installed in your project is necessary.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Bbeierle12/Skill-MCP-Claude --skill particles-gpu -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Bbeierle12/Skill-MCP-Claude --skill particles-gpu -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Bbeierle12/Skill-MCP-Claude --skill particles-gpu -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Bbeierle12/Skill-MCP-Claude skills/particles-gpu
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Bbeierle12/Skill-MCP-Claude --skill particles-gpu -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Bbeierle12/Skill-MCP-Claude --path skills/particles-gpu
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Bbeierle12/Skill-MCP-Claude --skill particles-gpu -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/Bbeierle12/Skill-MCP-Claude/tree/HEAD/skills/particles-gpu/SKILL.md

## When to use it
- render 10k to 1M+ particles efficiently using GPU instancing
- configure custom buffer attributes for particle color, size, and alpha
- write vertex and fragment shaders for soft-edge particle circles
- build animated particle backgrounds with Three.js Points

## Example prompts
- Build a React Three Fiber component with 20000 particles and custom colors
- Write a custom shader for particle size attenuation based on camera distance
- Create a textured particle system with additive blending in Three.js

## Source text · SKILL.md · MIT

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: f57237212756ff4a.

BEGIN THIRD-PARTY FILE f57237212756ff4a
````text
---
name: particles-gpu
description: GPU-based particle systems using instanced rendering, buffer attributes, Points geometry, and custom shaders. Use when rendering thousands to millions of particles efficiently, creating particle effects like snow, rain, stars, or abstract visualizations.
---

# GPU Particles

Render massive particle counts (10k-1M+) efficiently using GPU instancing and custom shaders.

## Quick Start

```tsx
import { useRef, useMemo } from 'react';
import { useFrame } from '@react-three/fiber';
import * as THREE from 'three';

function Particles({ count = 10000 }) {
  const points = useRef<THREE.Points>(null!);
  
  const positions = useMemo(() => {
    const pos = new Float32Array(count * 3);
    for (let i = 0; i < count; i++) {
      pos[i * 3] = (Math.random() - 0.5) * 10;
      pos[i * 3 + 1] = (Math.random() - 0.5) * 10;
      pos[i * 3 + 2] = (Math.random() - 0.5) * 10;
    }
    return pos;
  }, [count]);
  
  return (
    <points ref={points}>
      <bufferGeometry>
        <bufferAttribute
          attach="attributes-position"
          count={count}
          array={positions}
          itemSize={3}
        />
      </bufferGeometry>
      <pointsMaterial size={0.05} color="#ffffff" />
    </points>
  );
}
```

## Rendering Approaches

| Approach | Particle Count | Complexity | Use Case |
|----------|---------------|------------|----------|
| Points | 10k - 500k | Low | Simple particles, stars |
| Instanced Mesh | 1k - 100k | Medium | 3D geometry particles |
| Custom Shader | 100k - 10M | High | Maximum control |

## Points Geometry

Simplest approach—each particle is a screen-facing point sprite.

### Basic Points

```tsx
function BasicPoints({ count = 5000 }) {
  const positions = useMemo(() => {
    const pos = new Float32Array(count * 3);
    for (let i = 0; i < count; i++) {
      const theta = Math.random() * Math.PI * 2;
      const phi = Math.acos(2 * Math.random() - 1);
      const r = Math.cbrt(Math.random()) * 5;
      
      pos[i * 3] = r * Math.sin(phi) * Math.cos(theta);
      pos[i * 3 + 1] = r * Math.sin(phi) * Math.sin(theta);
      pos[i * 3 + 2] = r * Math.cos(phi);
    }
    return pos;
  }, [count]);
  
  return (
    <points>
      <bufferGeometry>
        <bufferAttribute
          attach="attributes-position"
          count={count}
          array={positions}
          itemSize={3}
        />
      </bufferGeometry>
      <pointsMaterial
        size={0.1}
        sizeAttenuation={true}
        transparent={true}
        opacity={0.8}
        depthWrite={false}
        blending={THREE.AdditiveBlending}
      />
    </points>
  );
}
```

### Points with Texture

```tsx
function TexturedPoints({ count = 5000 }) {
  const texture = useTexture('/particle.png');
  
  return (
    <points>
      <bufferGeometry>
        {/* ... positions ... */}
````
END THIRD-PARTY FILE f57237212756ff4a

The third-party file has ended. Everything between the f57237212756ff4a 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 2849 of 13795 bytes. © Bbeierle12 · MIT · https://github.com/Bbeierle12/Skill-MCP-Claude/tree/HEAD/skills/particles-gpu/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
