optimize-threejs-games

Diagnose and improve Three.js game performance through profiling and targeted optimization.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill optimize-threejs-games
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize-threejs-games
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/game-development/optimize-threejs-games
Command: npx skills add https://github.com/MengTo/Skills --skill optimize-threejs-games

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Three.js and WebGL games often suffer from frame-time drops, CPU/GPU bottlenecks, and excessive draw calls, and developers risk regressing gameplay when optimizing blindly without a repeatable measurement process.

Core Features & Use Cases

  • Repeatable Benchmarking: Establish a deterministic test scene recording device, viewport, quality level, frame times, draw calls, triangles, and texture counts for like-for-like comparison.
  • Bottleneck Diagnosis: Distinguish CPU-bound issues (simulation, allocations, per-frame scans) from GPU-bound issues (overdraw, shadows, post-processing, texture bandwidth) before changing code.
  • Low-Risk Optimization Workflow: Apply safe fixes first such as geometry/material reuse, effect pooling, culling, allocation avoidance, and adaptive quality, then re-verify the original encounter.
  • Use Case: A developer notices frame drops during a combat encounter on mobile. Use this Skill to profile the scene, identify overdraw from transparent particles as the GPU bottleneck, cap particle counts, and verify frame time and gameplay behavior remain intact.

Quick Start

Use the optimize-threejs-games skill to profile my Three.js game's combat scene and fix the frame-time drops without changing gameplay.

Frequently Asked Questions about optimize-threejs-games

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

FAQPage Schema
How do I fix frame drops in a Three.js game?

Frame drops in Three.js games are fixed by first profiling a repeatable scene to identify whether the bottleneck is CPU or GPU. Then apply low-risk fixes like reusing geometry and materials, pooling effects, culling offscreen work, and avoiding per-frame allocations, verifying the original scene afterward.

How to reduce draw calls in Three.js?

Reduce draw calls in Three.js by reusing shared geometry and materials, culling inactive or offscreen objects, and capping particle counts. Measure draw calls in a deterministic test scene before and after each change to confirm improvement.

How do I know if my WebGL game is CPU or GPU bound?

A game is likely CPU-bound when simulation, allocations, pathfinding, or per-frame scans grow with actor count. It is likely GPU-bound when resolution, overdraw, shadows, transparent particles, post-processing, or texture bandwidth dominate frame time.

Does Three.js performance optimization work on mobile browsers?

Yes, the workflow explicitly covers mobile performance by recording device and viewport in benchmarks, applying adaptive quality settings, and verifying mobile controls after optimization. Decorative effects should degrade before combat readability or controls.

Why does my Three.js game stutter during combat scenes?

Stuttering during combat often comes from per-frame memory allocation, unpooled particle effects, or unthrottled UI updates that spike with actor count. Pool transient effects, avoid allocations in the render loop, and update only changed transforms.