浏览代码

FBX: Add additional material properties.

Currently there isnt a AI_MATKEY_DISPLACEMENTSCALING define but fbx supports the value so for the moment it is just manually specified.
Matt Oliver 8 年之前
父节点
当前提交
2f2fe92b62
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      code/FBXConverter.cpp

+ 10 - 0
code/FBXConverter.cpp

@@ -2134,6 +2134,16 @@ void Converter::SetShadingPropertiesCommon( aiMaterial* out_mat, const PropertyT
     if ( ok ) {
     if ( ok ) {
         out_mat->AddProperty( &ShininessExponent, 1, AI_MATKEY_SHININESS );
         out_mat->AddProperty( &ShininessExponent, 1, AI_MATKEY_SHININESS );
     }
     }
+
+    const float BumpFactor = PropertyGet<float>(props, "BumpFactor", ok);
+    if (ok) {
+        out_mat->AddProperty(&BumpFactor, 1, AI_MATKEY_BUMPSCALING);
+    }
+
+    const float DispFactor = PropertyGet<float>(props, "DisplacementFactor", ok);
+    if (ok) {
+        out_mat->AddProperty(&DispFactor, 1, "$mat.displacementscaling", 0, 0);
+    }
 }
 }