ModelTranslator: support external-texture FBX (disk AO fallback search, missing-texture graceful degradation)

This commit is contained in:
ud18010
2026-07-15 12:16:24 +08:00
parent 0b068dbaa0
commit 78b250355b
2 changed files with 67 additions and 7 deletions
+3 -1
View File
@@ -36,7 +36,8 @@ out/tong/
## 转换规则
- 贴图识别:沿材质 Principled BSDF 连线找 Base Color / Alpha / Normal / Metallic / RoughnessAO 按贴图名匹配(含 `ao`/`occlusion`/`ambient`
- 贴图识别:沿材质 Principled BSDF 连线找 Base Color / Alpha / Normal / Metallic / Roughness内嵌与外置贴图(FBX 旁的松散文件)均支持
- AO 按贴图名匹配(含 `ao`/`occlusion`/`ambient`):先找材质内引用的贴图;FBX 未引用时自动搜索 FBX 同目录的图片文件,多候选优先与颜色贴图同前缀(`xxx_color.png``xxx_ao.png`
- 基础贴图 A 通道自动判定:**透明贴图 > 颜色贴图自带 alpha > AO 贴图 > 填白(255)**;判定为透明时 `.mat` 自动勾选 `Alpha As Transparency`AlphaTest 裁剪)
- 无对应贴图的通道用 Principled 常量值填充(会在日志中标注 `(常量)`
- 目标尺寸 = min(2048, 源贴图最大边),所有贴图缩放到统一尺寸
@@ -48,6 +49,7 @@ out/tong/
- 法线按 OpenGL 约定(+Y 向上)处理,不提供绿通道翻转
- 不做多材质图集合并/UV 重排;每材质一套贴图
- 动画/骨骼随 FBX 原样导出,不做处理
- 外置贴图文件丢失时打警告并退化为常量,不中断转换
## 开发