Skip to content
Back to skills

Using Threejs

ASecurity

Use when building or editing a 3D scene in Three.js for WebGL or WebGPU, or making one render faster. Triggers on files with `three` or `three/*` imports, Scene, Renderer, Mesh, BufferGeometry, materials, lights, GLTF loaders, raycasting, shaders, post-processing, or instancing, even when the user doesn't say 'Three.js'.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsrustgonodeapiperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 30, 2026

npx -y skills add xonovex/platform --skill using-threejs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Using Threejs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Using Threejs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/xonovex-using-threejs/badge)](https://www.skillsdirectory.com/skills/xonovex-using-threejs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: using-threejs
description: "Use when building or editing a 3D scene in Three.js for WebGL or WebGPU, or making one render faster. Triggers on files with `three` or `three/*` imports, Scene, Renderer, Mesh, BufferGeometry, materials, lights, GLTF loaders, raycasting, shaders, post-processing, or instancing, even when the user doesn't say 'Three.js'."
---

# Three.js Coding Guidelines

Vanilla Three.js for scene setup, rendering, meshes, materials, lights, animation, interaction, and effects.

## Essentials

- **Scene structure** - Organize Object3D hierarchy; use Groups for logical organization, see [references/scene-fundamentals.md](references/scene-fundamentals.md)
- **Render loop** - Frame-rate independence with `clock.getDelta()`, see [references/scene-fundamentals.md](references/scene-fundamentals.md)
- **Disposal** - Dispose geometries, materials, textures to prevent memory leaks, see [references/scene-fundamentals.md](references/scene-fundamentals.md)
- **Pixel ratio** - Cap at 2 with `Math.min(devicePixelRatio, 2)`, see [references/scene-fundamentals.md](references/scene-fundamentals.md)
- **Color space** - `NoColorSpace` for data textures (normal/roughness/metalness), not sRGB, see [references/textures.md](references/textures.md)
- **Shadows** - Enable on renderer, light, mesh; keep frustum tight, see [references/lighting-shadows.md](references/lighting-shadows.md)

## Core Topics

- Read [references/scene-fundamentals.md](references/scene-fundamentals.md) - Scene, Renderer, Object3D, cleanup, render loop
- Read [references/geometry.md](references/geometry.md) - Shapes, BufferGeometry, custom geometry, instancing
- Read [references/cameras-controls.md](references/cameras-controls.md) - Cameras, OrbitControls, FlyControls, viewport
- Read [references/materials.md](references/materials.md) - PBR materials, ShaderMaterial, properties
- Read [references/textures.md](references/textures.md) - Loading, UV mapping, render targets, environment
- Read [references/lighting-shadows.md](references/lighting-shadows.md) - Lights, shadows, IBL, light probes
- Read [references/animation.md](references/animation.md) - Keyframes, skeletal, morph targets, AnimationMixer
- Read [references/interaction.md](references/interaction.md) - Raycasting, selection, drag, coordinate conversion
- Read [references/loaders.md](references/loaders.md) - GLTF, FBX, textures, HDR, compression
- Read [references/shaders.md](references/shaders.md) - GLSL shaders, uniforms, varyings
- Read [references/postprocessing.md](references/postprocessing.md) - Bloom, DOF, SSAO, custom effects
- Read [references/performance.md](references/performance.md) - InstancedMesh, LOD, culling, batching, profiling
- Read [references/patterns.md](references/patterns.md) - Architecture patterns, asset management, state machines
- Read [references/math.md](references/math.md) - Vector3, Matrix4, Quaternion, Box3, curves, MathUtils
- Read [references/node-materials.md](references/node-materials.md) - TSL (Three Shading Language), node-based materials
- Read [references/physics-vr.md](references/physics-vr.md) - Physics engines (Rapier, Cannon), WebXR (VR/AR)
- Read [references/webgpu.md](references/webgpu.md) - WebGPU renderer, compute shaders, modern GPU

## Gotchas

- Geometries, materials, and textures must be explicitly `.dispose()`d: JS GC doesn't free GPU memory; long sessions leak VRAM
- `BufferGeometry` replaced legacy `Geometry` years ago: old tutorials using `Geometry` silently fail on current versions
- `renderer.setPixelRatio(window.devicePixelRatio)` is critical for retina, without it, scenes render at 1× and look blurry
- Loading a `.glb`/`.gltf` is async: accessing `scene.children` immediately after `loader.load()` returns an empty array

Files in this skill

  • SKILL.md3.7 KB
  • eval-output.json3.2 KB
  • eval-trigger.json5.5 KB
  • moon.yml86 B
  • references/animation.md1.1 KB
  • references/cameras-controls.md1.2 KB
  • references/geometry.md1 KB
  • references/interaction.md1 KB
  • references/lighting-shadows.md1.2 KB
  • references/loaders.md1.1 KB
  • references/materials.md991 B
  • references/math.md1 KB
  • references/node-materials.md1.2 KB
  • references/patterns.md1 KB
  • references/performance.md961 B
  • references/physics-vr.md1.5 KB
  • references/postprocessing.md939 B
  • references/scene-fundamentals.md1.1 KB
  • references/shaders.md1.1 KB
  • references/textures.md877 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.