threejs-postprocessing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Postprocessing Pipelines

后处理管线

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.
Identify the existing renderer and composer family before adding passes. Three.js WebGL EffectComposer, pmndrs postprocessing, and WebGPU node pipelines have different contracts. Choose one coherent pipeline for the requested backend.
Write down the render order, intermediate color space, target precision, depth requirements, alpha behavior, and final display conversion. Apply tone mapping/output conversion once in the appropriate place. Compare against direct rendering before stacking effects.
Use HDR scene values and a deliberate threshold for selective bloom. Avoid making the entire interface glow to disguise weak lighting. Depth-dependent effects need compatible depth data and sensible camera planes. Antialiasing must fit the final composition rather than assuming canvas MSAA smooths offscreen targets.
Resize all passes and targets with viewport and quality changes. Budget full-resolution targets and reduce effect resolution or disable expensive passes on weaker devices. Preserve HTML readability and transparent-canvas composition if the design uses it.
Dispose owned passes and render targets, including replacement pipelines. Verify disabled/enabled comparison, bright and dark content, alpha edges, resize, and effect cost on the target device. Keep effect tuning separate from fixing incorrectly tagged textures.
使用项目已安装的版本和现有架构。这些说明是对用户任务的补充;并不授权进行无关更改或外部操作。
在添加 passes 前,先确定现有 renderer 和 composer 体系。Three.js WebGL EffectComposer、pmndrs postprocessing 和 WebGPU node pipelines 的契约各不相同。为所请求的 backend 选择一条连贯的 pipeline。
记录渲染顺序、中间 color space、target precision、depth requirements、alpha behavior 和最终 display conversion。Tone mapping/output conversion 只在合适的位置应用一次。叠加 effects 前,先与直接渲染结果进行比较。
对选择性 bloom 使用 HDR scene values 和有意设定的 threshold。避免让整个界面发光来掩盖照明不足。依赖 depth 的 effects 需要兼容的 depth data 和合理的 camera planes。Antialiasing 必须适配最终合成过程,不能假设 canvas MSAA 会平滑离屏 targets。
视口和质量变化时,务必同步调整所有 passes 和 targets。对全分辨率 targets 进行预算,并在性能较弱的设备上降低 effect 分辨率或禁用开销较大的 passes。如果设计需要,确保 HTML 可读性和透明 canvas 合成不受影响。
释放自有 passes 和 render targets,包括替换后的 pipelines。在目标设备上验证禁用/启用效果对比、明亮和黑暗内容、alpha 边缘、resize 以及 effect 成本。将 effect 调优与修复纹理标签错误分开处理。

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.
查阅官方文档,以了解精确签名和版本特定行为。如果无法访问文档,请检查已安装的 types/source,并说明仍存在的不确定性。