threejs-debug-profiler
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThree.js Debug Profiler
Three.js 调试分析工具
Purpose
用途
Find root causes and optimize measured bottlenecks without breaking playability.
找出问题根源并优化已定位的性能瓶颈,同时不影响游戏的可玩性。
Debug Workflow
调试流程
Load as the first action when debugging render/runtime/mobile issues, asset loading, audio loading/playback, animation, resize, input, blank canvas, physics/collision bugs, or profiling performance. Track it in a reference ledger with yes/no, path, and failure reason. Do not mark the debug/profile phase complete while this reference is skipped for debug or profiling work.
references/debug-profile-checklists.mdLoad for render/runtime bug diagnosis, for profiling work, and for mobile render/input issues. Load only when the user asks for reusable debug/profile prompts or a task template.
references/checklists/scene-debugging.mdreferences/checklists/performance-profile.mdreferences/checklists/mobile-input.mdreferences/prompt-templates.md- Reproduce locally.
- Read console/page/network errors.
- Check canvas display size and drawing-buffer size.
- Check renderer/context/loop ownership.
- Check camera, aspect, near/far, lights, materials, fog, scene contents, transforms.
- Check asset paths/loaders/CORS/base path.
- Check animation delta units, physics/update order, fixed timestep, collider/body ownership, input listeners, pointer/touch behavior, resize, and audio context unlock/decode errors when audio is involved.
- Fix root cause in owning module.
- Verify browser screenshot, nonblank canvas, console/page errors, and broken path.
当调试渲染/运行时/移动端问题、资源加载、音频加载/播放、动画、窗口缩放、输入、空白画布、物理/碰撞错误或进行性能分析时,第一步需加载文件。将调试情况记录在参考台账中,包含是否完成、问题路径及失败原因。若调试或分析工作跳过该参考文件,则不得标记调试/分析阶段完成。
references/debug-profile-checklists.md进行渲染/运行时错误诊断时,加载;进行性能分析时,加载;处理移动端渲染/输入问题时,加载。仅当用户要求可复用的调试/分析提示词或任务模板时,才加载。
references/checklists/scene-debugging.mdreferences/checklists/performance-profile.mdreferences/checklists/mobile-input.mdreferences/prompt-templates.md- 在本地复现问题。
- 查看控制台/页面/网络错误信息。
- 检查画布显示尺寸与绘图缓冲区尺寸。
- 检查渲染器/上下文/循环的归属。
- 检查相机、宽高比、近/远裁剪面、灯光、材质、雾化效果、场景内容、变换属性。
- 检查资源路径/加载器/CORS/基础路径。
- 涉及音频时,检查动画增量单位、物理/更新顺序、固定时间步长、碰撞体/刚体归属、输入监听器、指针/触摸行为、窗口缩放,以及音频上下文解锁/解码错误。
- 在问题所属模块中修复根源问题。
- 验证浏览器截图、非空白画布、控制台/页面错误及已修复的问题路径。
Performance Workflow
性能优化流程
- Reproduce in correct build mode.
- Record baseline: FPS/frame time, draw calls, triangles, geometries, textures, memory, bundle.
- Identify CPU/GPU/memory/network bottleneck.
- Optimize one thing at a time: instancing, shared resources, culling, LOD, DPR cap, cheaper shadows/post, texture discipline.
- Re-measure same scenario and verify visuals/playability.
- 在正确的构建模式下复现问题。
- 记录基准指标:FPS/帧时间、绘制调用数、三角形数量、几何体数量、纹理、内存、包体积。
- 识别CPU/GPU/内存/网络瓶颈。
- 每次仅优化一项:实例化、共享资源、剔除、LOD细节层次、DPR上限、更轻量化的阴影/后处理、纹理规范。
- 重新测量同一场景并验证视觉效果/可玩性。
Final Response
最终反馈
Lead with root cause or bottleneck. Report the reference ledger, checklist items used, files changed, baseline/post metrics, commands, screenshots/artifacts, broken paths retested, and residual risks.
首先说明问题根源或性能瓶颈。汇报参考台账、使用的检查项、修改的文件、基准/优化后指标、执行的命令、截图/工件、重新测试的问题路径以及剩余风险。