threejs-debugging
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRendering Diagnostics
渲染诊断
Use the project's installed versions and existing architecture. These instructions supplement the user's task; they do not authorize unrelated changes or external actions.
Capture the visible symptom, console errors, failed requests, installed versions, backend, and a minimal reproduction before editing. Use the symptom tree to narrow likely causes.
For a blank canvas, first verify nonzero container/drawing dimensions, a live render loop, successful renderer creation, camera projection/framing, object visibility/layers, and valid finite transforms. Replace only the subject material with an unlit diagnostic material to distinguish lighting from geometry problems.
For asset failures inspect HTTP status, response content, CORS, decoder paths, and build base path. An HTML fallback response with status 200 is not a valid GLB. For color, trace texture classification through lighting, tone mapping, and output conversion.
For flicker inspect coplanar geometry, near/far precision, transparency sorting, duplicate render loops, and competing transform writers. For picking verify canvas/view-relative coordinates, matrices, layers, instancing, and shader deformation mismatch.
Reduce the failing scene one feature at a time while preserving evidence. Avoid unrelated dependency upgrades or disabling all error checks to make symptoms disappear. When context/device loss occurs, provide a clear recovery path rather than an unbounded renderer recreation loop.
Verify the original failing action after the fix and check adjacent states that share the same code. Explain the cause and evidence, not just the changed line.
使用项目已安装的版本和现有架构。这些说明是对用户任务的补充;它们不授权无关的更改或外部操作。
在编辑之前,捕获可见症状、控制台错误、失败的请求、已安装的版本、后端以及最小复现。使用症状树来缩小可能的原因范围。
对于空白画布,首先验证容器/绘制尺寸非零、渲染循环存活、渲染器创建成功、相机投影/构图、对象可见性/图层,以及有效的有限变换。仅将主题材质替换为无光照诊断材质,以区分光照问题与几何问题。
对于资源加载失败,检查 HTTP 状态、响应内容、CORS、解码器路径和构建基础路径。返回状态 200 的 HTML 回退响应不是有效的 GLB。对于颜色问题,追踪纹理分类在光照、色调映射和输出转换中的处理。
对于闪烁问题,检查共面几何、近/远精度、透明度排序、重复的渲染循环和相互竞争的变换写入器。对于拾取问题,验证画布/视图相对坐标、矩阵、图层、实例化和着色器变形不匹配。
在保留证据的同时,逐步减少失败场景中的功能。避免无关的依赖升级或禁用所有错误检查来使症状消失。当发生上下文/设备丢失时,提供清晰的恢复路径,而不是无限制的渲染器重建循环。
修复后验证原始失败操作,并检查共享相同代码的相邻状态。解释原因和证据,而不仅仅是更改的行。
API reference
API 参考
Consult the official documentation for exact signatures and revision-specific behavior. If documentation access is unavailable, inspect installed types/source and state any remaining uncertainty.
查阅官方文档以获取准确的签名和特定版本行为。如果文档访问不可用,请检查已安装的类型/源码,并说明任何剩余的不确定性。