feat: 材质系统 v1——4 纹理槽(albedo/normal/specular/emissive)+ 法线贴图

- Material:单贴图 → 4 槽(binding=Slot 枚举),MakeCacheKey 组合键
  保持材质去重(同贴图组合共享描述符集)
- Model:读取 aiTextureType DIFFUSE/NORMALS/SPECULAR/EMISSIVE 四类路径;
  aiProcess_CalcTangentSpace 生成切线(Vertex +tangent 属性,location 3);
  每槽默认纹理兜底(白/平法线(128,128,255)/黑/黑,1x1)
- 纹理 sRGB 语义按槽位:颜色图 SRGB 变体,数据图(Normal/Specular)线性
  UNORM——Texture 路径加载加 srgb 参数;修复 InitFromPixels 图文 format
  不一致的 validation 警告
- UBO 尾部追加 cameraPos(Blinn-Phong V 向量)
- simple_shader.frag:TBN 法线贴图(无切线/平法线退化回几何法线)+
  Blinn-Phong 高光(specular 图强度系数)+ 自发光直加
- SunTemple 实测:148 张 DDS 全槽位加载(96 张线性变体)、1056 mesh、
  validation 零警告
This commit is contained in:
2026-09-23 14:50:10 +08:00
parent 8253c31ad5
commit c54f60c5ea
12 changed files with 229 additions and 92 deletions
+1
View File
@@ -177,6 +177,7 @@ namespace Engine
ubo.lights[i].color = glm::vec4(0.0f);
}
ComputeCascades(shadowDir);
ubo.cameraPos = glm::vec4(camera.GetPosition(), 1.0f);
// ---- 3. GPUDriven:单趟收集 + 双视图剔除 ----
// 每个实例对相机视锥、光源视锥分别做包围球测试: