materialDef.CheckTextures(MaterialDefinition::NORMAL))
{
hash.Add("3TEX");
+
+ // For the glTF, each of basecolor, metallic_roughness, normal texture is not essential.
+ if(materialDef.CheckTextures(MaterialDefinition::ALBEDO))
+ {
+ hash.Add("BCTEX");
+ }
+
+ if(materialDef.CheckTextures(MaterialDefinition::METALLIC | MaterialDefinition::ROUGHNESS))
+ {
+ hash.Add("MRTEX");
+ }
+
+ if(materialDef.CheckTextures(MaterialDefinition::NORMAL))
+ {
+ hash.Add("NTEX");
+ }
}
if(materialDef.GetAlphaCutoff() > 0.f)
hash.Add("FLIP" /*_V*/);
}
+ if(meshDef.mColors.IsDefined())
+ {
+ hash.Add("COLATT");
+ }
+
+ if(meshDef.mTangentType == Property::VECTOR4)
+ {
+ hash.Add("V4TAN");
+ }
+
if(meshDef.HasBlendShapes())
{
bool hasPositions = false;
shaderDef.mDefines.push_back("FLIP_V");
}
+ if(meshDef.mColors.IsDefined())
+ {
+ shaderDef.mDefines.push_back("COLOR_ATTRIBUTE");
+ }
+
+ if(meshDef.mTangentType == Property::VECTOR4)
+ {
+ shaderDef.mDefines.push_back("VEC4_TANGENT");
+ }
+
if(meshDef.HasBlendShapes())
{
bool hasPositions = false;
}
}
- if(meshDef.mTangentType == Property::VECTOR4)
- {
- shaderDef.mDefines.push_back("VEC4_TANGENT");
- }
-
shaderDef.mUniforms["uMaxLOD"] = 6.f;
shaderDef.mUniforms["uCubeMatrix"] = Matrix::IDENTITY;