Skip to content
Skills Library
Programming · Building & coding

web3d-craft

/web3d-craft

Web 3D engineering standards — Three.js / React Three Fiber stack selection, render-loop and performance discipline, shader cost awareness, asset pipeline (glTF/Draco/KTX2), memory disposal, and the 3D pre-delivery checklist. Use when building any WebGL/WebGPU, Three.js, R3F, shader or interactive 3D web experience.

Repository
skills ↗
Licence
MIT
Last repository change
13.07.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Web 3D engineering standards — Three.js / React Three Fiber stack selection, render-loop and performance discipline, shader cost awareness, asset pipeline (glTF/Draco/KTX2), memory disposal, and the 3D pre-delivery checklist. Use when building any WebGL/WebGPU, Three.js, R3F, shader or interactive 3D web experience.

Original author description

Web 3D engineering standards — Three.js / React Three Fiber stack selection, render-loop and performance discipline, shader cost awareness, asset pipeline (glTF/Draco/KTX2), memory disposal, and the 3D pre-delivery checklist. Use when building any WebGL/WebGPU, Three.js, R3F, shader or interactive 3D web experience.

How it works

  1. Stack selection (decide before coding)
  2. R3F hard rules (violations are audit findings)
  3. Performance budget (test against real, mid-range hardware)
  4. Shader discipline (GLSL/WGSL)
  5. Asset pipeline
  6. Memory & lifecycle (leaks are CRITICAL findings)
  7. UX floor for 3D surfaces
  8. Pre-delivery checklist
Original SKILL.md headings · 88 lines, 682 words
SKILL.md preview
---
name: web3d-craft
description: Web 3D engineering standards — Three.js / React Three Fiber stack selection, render-loop and performance discipline, shader cost awareness, asset pipeline (glTF/Draco/KTX2), memory disposal, and the 3D pre-delivery checklist. Use when building any WebGL/WebGPU, Three.js, R3F, shader or interactive 3D web experience.
user-invocable: false
---

# Web 3D Craft

## Stack selection (decide before coding)

| Scenario | Stack | Why |
|---|---|---|
| Marketing page with scroll-driven 3D | Three.js + GSAP ScrollTrigger (+ React for UI) | GSAP owns scroll orchestration |
| React app with interactive 3D (product viewer, configurator) | React Three Fiber + Drei | declarative, state-driven |
| Complex timeline sequences in React | R3F + GSAP timelines | best of both |
| Physics-feel interactions (drag, momentum) | R3F + React Spring (+ Rapier for real physics) | natural springs |
| Particle-heavy / maximum control | plain Three.js | imperative control, instancing |

Follow the project's existing choice; never mix two animation libraries on the
same property — one owner per animated value.

## R3F hard rules (violations are audit findings)

- **Never `setState` inside `useFrame`** — that's 60 re-renders/second. Mutate
  refs directly (`meshRef.current.rotation.y += delta`); React state only for
  discrete changes (selection, mode), synced via zustand when global.
- Static scenes: `frameloop="demand"` on Canvas + `invalidate()` on change —
  don't burn GPU on an unchanging frame.
- `dpr={[1, 2]}` adaptive pixel ratio; load assets via Suspense
  (`useGLTF`, `useTexture`) with a designed fallback.
- Reuse geometries/materials across instances; hoist them out of components so
  re-renders don't recreate GPU resources.

## Performance budget (test against real, mid-range hardware)

- Target 60fps desktop / stable 30+ mobile; frame time is the metric, not vibes.
- Draw calls: prefer < ~100 for scenes with UI; merge static meshes; use
  `InstancedMesh` for repeated objects (100 trees = 1 draw call, not 100).
- Use delta time for all motion — never assume frame rate.
- LOD for anything far away; frustum culling stays on; shadows are the first
  thing to cheapen (resolution, distance) when the budget breaks.
- Lights are expensive: bake what doesn't move, limit real-time lights, prefer
  environment maps for ambience.

## Shader discipline (GLSL/WGSL)

- Instruction cost awareness: add/mul = 1×, divide/sqrt ≈ 4×, texture sample ≈
  4–8×, sin/cos/pow ≈ 8×. Move work from fragment to vertex shader when it
  interpolates acceptably; precompute into uniforms/textures what doesn't change
  per-pixel.
- Pink/magenta material = shader compile failure — read the log, don't guess.
- Keep custom shaders in separate `.glsl` files (or tagged template constants),
  named uniforms documented at the top.

## Asset pipeline

- glTF/GLB only for models; Draco or Meshopt compression; KTX2/basis for
  textures where the loader stack supports it. No multi-MB PNGs on 3D surfaces.
- Power-of-two texture sizes; mipmaps on; texel density consistent across
  surfaces the camera sees at the same distance.
- "Apply scale and rotation before export. No exceptions." — imported models
  arrive at scale 1, Y-up, forward-consistent; fix at the source, not with
  wrapper-group hacks.

## Memory & lifecycle (leaks are CRITICAL findings)

- Everything you create, you dispose: `geometry.dispose()`,
  `material.dispose()`, `texture.dispose()`, and `renderer.dispose()` on
  teardown. In R3F, prefer letting the renderer manage it — but anything created
  imperatively is yours to clean.
- Kill animations on unmount (GSAP `tween.kill()`, spring `stop()`); remove
  event/scroll listeners; cancel the RAF loop you own.
- Navigating away from and back to the 3D view repeatedly must not grow memory —
  test it (Performance/Memory panel), don't assume it.

## UX floor for 3D surfaces

- Loading state with progress for anything over ~1MB of assets; the page must
  never freeze white while a scene compiles.
- A non-WebGL/reduced fallback (static render or poster) when the context fails;
  respect `prefers-reduced-motion` by pausing idle animation.
- 3D canvas must not steal page scroll unexpectedly; touch gestures on mobile
  need explicit design (orbit vs page-scroll conflict is the classic fail).

## Pre-delivery checklist

- [ ] Frame rate measured (desktop + mobile emulation) on the heaviest scene — meets budget.
- [ ] Draw call count sane (renderer.info); repeated objects instanced.
- [ ] Assets compressed (Draco/Meshopt, KTX2/resized textures); total 3D payload reported in the ticket.
- [ ] Mount/unmount cycle leak-tested; animations and listeners cleaned up.
- [ ] Loading, fallback and reduced-motion paths exist and were exercised.
- [ ] One animation owner per property — no library fights.

Versions

The database has no other skills named web3d-craft.

Database snapshot: 13.11.2026 · package version 49681f7dcb0d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95web3d-webgl
    Use this skill when the user says 'Three.js', 'React Three Fiber', 'R3F', 'drei', '3D in the browser', 'GLTF model loading', 'product configurator 3D', 'WebGL scene performance', 'three.js memory leak'. It builds and optimises Three.js / React Three Fiber scenes: renderer setup,…
  • 100threejs
    Three.js is a JavaScript library for building interactive 3D graphics in the browser with WebGL and WebGPU. Use it for 3D product configurators, data visualizations, games and creative sites: scenes, cameras, lighting, glTF model loading, performance tuning, and React Three…
  • 90threejs-3d
    Build and optimize browser 3D scenes with Three.js, React Three Fiber, WebGPU or WebGL, TSL and glTF assets. Use when implementing cameras, materials, 3D interaction, model loading or renderer performance; preserve renderer compatibility and resource ownership.
  • 90react-craft
    React-specific engineering standards — impact-prioritized performance rules (waterfalls, bundle, re-renders), hooks discipline, RSC/server data, TypeScript-with-React, forms, and AI-feature patterns. Loaded on top of frontend-craft when the ticket's stack is React (incl.…
  • 1003d-web-experience
    Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience.
  • 100threejs-react-three-fiber
    Building three.js scenes from React with React Three Fiber and drei: renderer setup, the scene graph as JSX, frame-loop, state and loading hooks, pointer events, and adaptive performance, on WebGL or with WebGPU and TSL. Use when writing React components that render three.js.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.