threejs-materials
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMaterials and Textures
材质与纹理
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 whether the material needs unlit color, PBR lighting, or a specialized physical effect. Start with the least costly material that achieves the requested surface. Physical transmission, clearcoat, and other layers can increase rendering cost.
Classify textures by meaning. Color textures such as base color and emissive use the appropriate color space; normal, roughness, metallic, AO, and other data maps remain non-color data. Preserve loader-assigned glTF settings unless evidence shows they are wrong. Match UV channels, wrapping, orientation, and sampler requirements to the installed revision.
Reason in linear light and apply display conversion once. Trace renderer output, tone mapping, and postprocessing together before changing exposure to hide incorrect color configuration. Check a neutral material and reference lighting when matching product color.
Choose opacity treatment deliberately: opaque, cutout/alpha test, hashed coverage where supported, or blended transparency. Blended transparency has sorting limitations; renderOrder cannot solve every intersecting-surface artifact. Evaluate depthWrite, face orientation, and shadow behavior on representative overlaps.
Changing a uniform-like value usually differs from changing a shader-defining feature; set material.needsUpdate when required by that feature. Clone only the material that needs independent edits and keep shared textures shared. Dispose owned materials and textures separately.
Verify under neutral and final lighting, at oblique viewing angles, with overlapping transparent surfaces, and at the intended mobile texture resolution.
使用项目已安装的版本和现有架构。这些说明是对用户任务的补充;不授权进行无关更改或外部操作。
判断材质需要采用 unlit 颜色、PBR 光照,还是特殊的物理效果。优先使用能够实现目标表面的成本最低的材质。物理透射、clearcoat 和其他层可能会增加渲染成本。
按含义对纹理进行分类。基础色和自发光等颜色纹理应使用适当的色彩空间;法线、粗糙度、金属度、AO 和其他数据贴图仍应作为非颜色数据处理。除非有证据表明加载器分配的 glTF 设置有误,否则应予以保留。根据已安装的版本匹配 UV 通道、纹理环绕、方向和采样器要求。
在线性光照空间中推理,并且只应用一次显示转换。在调整曝光以掩盖错误的颜色配置之前,应整体追踪渲染器输出、tone mapping 和 postprocessing。匹配产品颜色时,使用中性材质和参考光照进行检查。
有意识地选择透明度处理方式:不透明、cutout/alpha test、支持时采用 hashed coverage,或 blended transparency。混合透明度存在排序限制;renderOrder 无法解决所有相交表面的伪影。在具有代表性的重叠对象上评估 depthWrite、面朝向和阴影行为。
更改类似 uniform 的值通常与更改定义 shader 的特性不同;当该特性要求时,设置 material.needsUpdate。仅克隆需要独立编辑的材质,并让共享纹理继续共享。分别释放自行创建的材质和纹理。
在环境中性光照和最终光照下、斜视角下、存在重叠透明表面时,以及在目标移动设备纹理分辨率下进行验证。
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.
查阅官方文档,以了解确切的函数签名和特定版本的行为。如果无法访问文档,则检查已安装的类型定义或源代码,并说明仍然存在的不确定性。