threejs-mastery
Skill1 starsChanged 13 days agoMITView on GitHub
Architect, implement, and audit Awwwards-grade, high-performance 3D WebGL/WebGPU web experiences using Three.js, React Three Fiber, OrbitControls, PBR materials, custom GLSL shaders, GLTF/GLB models, and post-processing bloom.
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
NEVER use 2D canvas context (ctx = canvas.getContext('2d')) to fake 3D math with rudimentary dots or wireframes.
- Very specific: line 19
Always instantiate THREE.WebGLRenderer with antialias: true, alpha: true, and powerPreference: "high-performance".
- Very specific: line 26
Use THREE.MeshPhysicalMaterial or THREE.MeshStandardMaterial.
- Distinctive: line 30
Every 3D scene must feature a deliberate 3-point or dynamic orbital lighting system:
- Very specific: line 36
Always integrate OrbitControls with enableDamping: true and dampingFactor: 0.05 for natural, tactile inertia.
- Very specific: line 141
When loading custom 3D assets, use THREE.GLTFLoader with THREE.DRACOLoader for sub-megabyte fast transmission.
- Very specific: line 143
Never freeze the main thread: parse geometries asynchronously and use instanced rendering (THREE.InstancedMesh) for repeating components.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Three.js & WebGL 3D Creative Engineering Mastery
Directives for building award-winning, 60FPS hardware-accelerated 3D web experiences comparable to Threejs.org, Bruno Simon, Apple Showcases, and Active Theory.
⚡ 1. INVIOLABLE AWWWARDS ARCHITECTURAL INVARIANTS
- Hardware WebGL 2.0 / WebGPU Only:
- NEVER use 2D canvas context (
ctx = canvas.getContext('2d')) to fake 3D math with rudimentary dots or wireframes. - Always instantiate
THREE.WebGLRendererwithantialias: true,alpha: true, andpowerPreference: "high-performance". - Set
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2))to prevent mobile GPU throttling while preserving razor-sharp fidelity.
- NEVER use 2D canvas context (
- Cinematic Tonemapping & Exposure:
- Enforce
renderer.toneMapping = THREE.ACESFilmicToneMappingwithrenderer.toneMappingExposure = 1.2for deep contrast, eliminating washed-out white highlights.
- Enforce
- Physically Based Rendering (PBR) Materials:
- Use
THREE.MeshPhysicalMaterialorTHREE.MeshStandardMaterial. - Configure realistic optical properties:
roughness,metalness,clearcoat: 1.0,clearcoatRoughness: 0.1, andtransmissionfor luxury frosted glass aesthetics.
- Use
- Multi-Point Dynamic Lighting Rig:
- Every 3D scene must feature a deliberate 3-point or dynamic orbital lighting system:
- Key Light: Primary illumination with specular sheen.
- Accent / Fill Light: Chromatically contrasting light (e.g., Electric Cyan + Deep Nebula Violet).
- Rim / Ambient Light: Subtle specular backlighting preventing pitch-black clipping.
- Every 3D scene must feature a deliberate 3-point or dynamic orbital lighting system:
- Fluid 60FPS Physics & Responsive Viewports:
- Always integrate
OrbitControlswithenableDamping: trueanddampingFactor: 0.05for natural, tactile inertia. - On
window.resize, recalculatecamera.aspect = width / height, callcamera.updateProjectionMatrix(), and updaterenderer.setSize().
- Always integrate
- Interactive Raycasting & Spatial Hover:
- Connect
THREE.Raycasterto mouse/pointer coordinates so interactive 3D geometry reacts to hover (subtle scale, emissive glow pulsation, holographic HUD tooltips).
- Connect
🚀 2. CANONICAL PRODUCTION THREE.JS BOILERPLATE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Awwwards 3D Experience</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.js"></script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #05070d; overflow: hidden; font-family: system-ui, sans-serif; }
#canvas3d { position: fixed; inset: 0; width: 100%; height: 100%; }
.hud { position: fixed; z-index: 10; pointer-events: none; padding: 24px; color: #f8fafc; }
.interactive { pointer-events: auto; }
</style>
</head>
<body>
<canvas id="canvas3d"></canvas>
<div class="hud">
<h1>Quantum Dimension</h1>
<p>Interactive WebGL 3D</p>
</div>
<script>
const canvas = document.getElementById('canvas3d');
const scene = new THREE.Scene();
scene.fog = new THREE.FogExp2(0x05070d, 0.02);
const camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(0, 3, 25);
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true, powerPreference: "high-performance" });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.toneMapping = THREE.ACESFilmicToneMapping;
const controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
controls.dampingFactor = 0.05;
controls.autoRotate = true;
controls.autoRotateSpeed = 1.0;
// Lighting
scene.add(new THREE.AmbientLight(0x0a1128, 1.8));
const light1 = new THREE.PointLight(0x00f5ff, 4.0, 40);
light1.position.set(10, 10, 10);
scene.add(light1);
const light2 = new THREE.PointLight(0xa855f7, 3.5, 40);
light2.position.set(-10, -8, -10);
scene.add(light2);
// Geometry & Material
const geom = new THREE.TorusKnotGeometry(5, 1.5, 150, 32);
const mat = new THREE.MeshPhysicalMaterial({
color: 0x111c33,
roughness: 0.15,
metalness: 0.85,
clearcoat: 1.0,
clearcoatRoughness: 0.1
});
const mesh = new THREE.Mesh(geom, mat);
scene.add(mesh);
// Stardust Field
const count = 2000;
const pos = new Float32Array(count * 3);
for(let i = 0; i < count * 3; i++) pos[i] = (Math.random() - 0.5) * 80;
const pGeom = new THREE.BufferGeometry();
pGeom.setAttribute('position', new THREE.BufferAttribute(pos, 3));
const pMat = new THREE.PointsMaterial({ size: 0.6, color: 0x38bdf8, transparent: true, opacity: 0.7 });
scene.add(new THREE.Points(pGeom, pMat));
function animate() {
requestAnimationFrame(animate);
mesh.rotation.x += 0.005;
mesh.rotation.y += 0.008;
controls.update();
renderer.render(scene, camera);
}
animate();
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
</script>
</body>
</html>💎 3. POST-PROCESSING & GLTF INTEGRATION GUIDELINES
- When loading custom 3D assets, use
THREE.GLTFLoaderwithTHREE.DRACOLoaderfor sub-megabyte fast transmission. - For glowing neon/cyberpunk aesthetics, import
EffectComposer,RenderPass, andUnrealBloomPass(threshold: 0.2,strength: 1.5,radius: 0.8). - Never freeze the main thread: parse geometries asynchronously and use instanced rendering (
THREE.InstancedMesh) for repeating components.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- antigravity-agent/AGENTS.mdAGENTS.md
- claude-code-agent/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- ci/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/01-craftsman.mdcCursor rule
- .cursor/rules/02-architecture-standards.mdcCursor rule
- .cursor/rules/03-security-directives.mdcCursor rule
- .cursor/rules/04-testing-tdd.mdcCursor rule
- .cursor/rules/05-design-standards.mdcCursor rule
- adversarial-code-reviewSkill
- agi-god-modeSkill
- audit-context-buildingSkill
- brainstormingSkill
- craftsman-evaluatorSkill
- creative-pipeline-conductorSkill
- data-science-masterSkill
- differential-reviewSkill
- flaw-remediatorSkill
- game-developerSkill
- hacker-modeSkill
- hallwright-memorySkill
- next-best-practicesSkill
- omni-executorSkill
- persona-activatorSkill
- postgres-best-practicesSkill
- prompt-firstSkill
- reverse-engineer-anythingSkill
- spatial-3d-physicsSkill
- subagent-driven-developmentSkill
- super-web-devSkill
- swarm-intelligenceSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- writing-plansSkill
- zero-drift-sentinelSkill
- hwmemSkill
- prompt-firstSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

