threejs-debug-profiler

Diagnose and profile Three.js browser games for rendering, input, and performance issues.

1|Updated Aug 20, 2023
One-click install
npx skills add https://github.com/imanlangaran/mini-projects --skill threejs-debug-profiler-imanlangaran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-debug-profiler
Source: https://github.com/imanlangaran/mini-projects/tree/main/building-sell/.claude/skills/threejs-debug-profiler
Command: npx skills add https://github.com/imanlangaran/mini-projects --skill threejs-debug-profiler-imanlangaran

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Three.js browser games often suffer from blank canvases, broken asset loading, animation glitches, mobile input failures, and unexplained frame-rate drops that are hard to trace to a root cause. This Skill provides a structured debugging and profiling workflow that reproduces issues, isolates the owning module, and verifies fixes with measurable evidence. ## Core Features & Use Cases - Scene Debugging: Systematic checklists for blank canvas, camera, lighting, materials, asset loading, audio playback, animation loops, and physics/collision bugs. - Performance Profiling: Baseline and post-optimization measurement of FPS, draw calls, triangles, textures, memory, and bundle size, with targeted optimizations like instancing, culling, LOD, and DPR caps. - Mobile Input Diagnosis: Checklists for pointer events, touch-action CSS, safe-area insets, viewport configuration, and high-DPR scaling issues. - Use Case: A developer's Three.js game renders a black screen on mobile and stutters on desktop. The Skill walks through canvas sizing, renderer ownership, and asset path checks to find the root cause, then profiles draw calls and texture memory to guide a measured optimization pass. ## Quick Start Use the threejs-debug-profiler skill to diagnose why my Three.js game shows a blank canvas and profile its frame rate on mobile.

Frequently Asked Questions about threejs-debug-profiler

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

FAQPage Schema
How do I debug a blank canvas in a Three.js game?

Blank canvas debugging starts by reproducing the issue locally, then checking console errors, canvas CSS and drawing-buffer sizes, WebGL context creation, camera aspect and near/far planes, lights, and material visibility. The scene-debugging checklist orders these checks so the root cause is found before editing code.

How to profile Three.js performance and reduce draw calls?

Profile by recording baseline FPS, frame time, renderer.info render calls, triangles, geometries, and textures in a production build. Then classify the bottleneck as CPU, GPU draw, GPU fragment, or memory, and apply one optimization at a time such as InstancedMesh, shared materials, frustum culling, or DPR caps, re-measuring after each change.

Why does my Three.js game have touch input problems on mobile?

Mobile input failures usually come from missing touch-action CSS, pointer listeners attached to the wrong element, page scroll stealing gestures, or missing viewport meta tags. The mobile input checklist covers pointer capture, safe-area insets, high-DPR scaling, and verification with mobile emulation.

What metrics should I measure when optimizing WebGL rendering?

Measure FPS and frame time after warmup, plus renderer.info fields: render.calls, triangles, points, lines, memory.geometries, and memory.textures. Also track render targets, post-processing passes, texture dimensions, bundle size, and JS heap to classify CPU, GPU, memory, or network bottlenecks.

When should I not optimize a Three.js game by removing visual detail?

Avoid removing visual detail before checking DPR caps, post-processing cost, shadow settings, instancing, and culling, since these often resolve frame-rate issues without degrading visuals. Optimizing development-server performance instead of a production preview build is also a common mistake.