Skip to content
Back to skills

Threejs

ASecurity

Use when an existing Three.js or React Three Fiber game needs skill contracts mapped onto its render loop, animation mixers, logical simulation, collision data, input, or camera system.

  • 11 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 23, 2026
developmentreactperformance

Works with

  • cli

Security analysis

A100/100

Scanned October 23, 2026

npx -y skills add jammyfu/open-game-skills --skill threejs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Threejs?

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

Security grade badge for Threejs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jammyfu-threejs/badge)](https://www.skillsdirectory.com/skills/jammyfu-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: threejs
description: Use when an existing Three.js or React Three Fiber game needs skill contracts mapped onto its render loop, animation mixers, logical simulation, collision data, input, or camera system.
---

# Three.js / R3F adapter

Inspect the installed Three.js/R3F package versions and the project's existing loop before deciding where simulation lives.

## Timing

`requestAnimationFrame` and R3F `useFrame` are frame-driven callbacks, not fixed gameplay ticks. `AnimationMixer.update(deltaTime)` advances animation by the supplied elapsed time and is commonly called from the render loop; it is presentation/animation timing unless the project explicitly makes it authoritative.

If the game already has a fixed logical accumulator, preserve its configured rate. If deterministic gameplay requires one and none exists, introduce an explicit accumulator as a project decision rather than hardcoding 60 Hz. `useFrame` may feed elapsed time into that accumulator, but render cadence never becomes the logical tick by implication.

## Bindings

- input: browser/device adapter into semantic actions;
- pose: `AnimationMixer.update(delta)` for presentation or logical pose snapshots where required;
- hits: authored Box3/sphere/capsule/custom gameplay volumes, not render mesh visibility;
- knockback: logical movement/collision owner;
- camera: collision-aware sweep/volume test implementing `camera-anti-clip`, not a single point ray.

Per-actor hitstop freezes that actor's logical/animation clock; do not stop the whole render loop.

## Lifecycle and resources

The engine-neutral rules live in `audio-feel`, `juice-vfx`, `asset-runtime`, `performance-budget` and `soak-stability`; this section only maps them onto Three.js in a browser.

- audio output: a Web Audio context starts suspended until a user gesture, so call `resume()` from one. Decode or synthesise buffers outside the presenting frame.
- background: hidden documents throttle or stop `requestAnimationFrame`. Clamp the logical accumulator's catch-up after resume, and do not take frame-time evidence from a hidden page.
- release: removing an `Object3D` does not dispose its geometry, material or texture. Share or pool them, and call `dispose()` through the lease owner when the last consumer releases them. Many small particles fit an `InstancedMesh` or a pooled buffer better than one mesh/material each.
- overlays: DOM/CSS layers (screen flashes, CSS filters on the canvas, overlay canvases) need explicit stacking against HUD elements. Clear their timers and restore filters on teardown.

## Accept

Record package versions, render-loop owner, configured logical tick (if any) and interpolation policy. Replay the same logical trace at multiple render rates; verify logical states/contact IDs match and report render/presentation latency separately.

Record the lifecycle hooks and resource release points used. A burst, teardown and background/resume cycle returns live effect, voice, timer and handle counts to the warm-up baseline; untested platforms remain `not-run`.

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

Comments

Loading comments…

Newsletter

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