threejs-engineering

Reviews and guides Three.js rendering code against performance and architecture best practices.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/Ohmnia/site-build --skill threejs-engineering-ohmnia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-engineering
Source: https://github.com/Ohmnia/site-build/tree/main/.opencode/skills/threejs-engineering
Command: npx skills add https://github.com/Ohmnia/site-build --skill threejs-engineering-ohmnia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Three.js codebases frequently suffer from memory leaks, excessive draw calls, transparency artifacts, and disorganized scene graphs. This Skill provides a concrete set of engineering rules, performance targets, and review checklists so AI-generated or hand-written Three.js code stays maintainable and performant. ## Core Features & Use Cases - Rendering Best Practices: Enforces geometry and material reuse, InstancedMesh for repeated objects, centralized animation loops, and proper resource disposal. - Performance Standards: Defines concrete budgets such as under 500 draw calls, 60 FPS on desktop, and triangle limits for mobile and desktop scenes. - Asset Pipeline Guidance: Recommends GLTF/GLB with Draco compression and KTX2 textures, plus Troika text instead of expensive TextGeometry. - Use Case: When asking an AI to build a 3D product configurator, this Skill ensures the generated code reuses materials, disposes resources on removal, limits shadow casters, and organizes the scene into logical groups. ## Quick Start Review my Three.js scene code and refactor it to follow the engineering best practices for geometry reuse, lighting, and memory management.

Frequently Asked Questions about threejs-engineering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce draw calls in a Three.js scene?

Reduce draw calls by using InstancedMesh for repeated objects, merging geometry, and sharing materials across meshes. Target under 500 draw calls and monitor actual counts via renderer.info during development.

How do I prevent memory leaks in Three.js applications?

Prevent memory leaks by calling dispose() on geometry, materials, and textures whenever objects are removed from the scene. Never create new geometries or materials inside render loops, as this causes continuous GPU allocation.

Should I use TextGeometry or Troika text in Three.js?

Use Troika text (troika-three-text) for labels, UI, HUD, and dynamic text because it renders faster with less memory. Reserve TextGeometry for logos, titles, and decorative hero graphics only.

Why does my Three.js transparent object flicker or sort incorrectly?

Transparency causes z-fighting and sorting artifacts due to render order issues. Prefer alphaTest (e.g., 0.5) over transparent: true when possible, and avoid placing text inside transparent objects.

What model format should I use for Three.js production apps?

Use GLTF or GLB formats with Draco mesh compression and KTX2 textures for production. Avoid OBJ and FBX, and keep textures at 1024-2048px for world assets, reserving 4096px for hero assets only.