Fixed bug that caused transparency values in FBX files to be imported incorrectly

This commit is contained in:
2013-05-01 17:54:48 -07:00
parent 09f6c3362d
commit 5f01257cee

View File

@@ -937,7 +937,7 @@ void LoadMaterial(KRContext &context, std::vector<KRResource *> &resources, FbxS
// Transparency
lKFbxDouble1 =((KFbxSurfacePhong *) pMaterial)->TransparencyFactor;
new_material->setTransparency(lKFbxDouble1.Get());
new_material->setTransparency(1.0f - lKFbxDouble1.Get());
// Shininess
lKFbxDouble1 =((KFbxSurfacePhong *) pMaterial)->Shininess;
@@ -972,7 +972,7 @@ void LoadMaterial(KRContext &context, std::vector<KRResource *> &resources, FbxS
// Opacity
lKFbxDouble1 =((KFbxSurfaceLambert *)pMaterial)->TransparencyFactor;
new_material->setTransparency(lKFbxDouble1.Get());
new_material->setTransparency(1.0f - lKFbxDouble1.Get());
} else {
printf("Error! Unable to convert material: %s", pMaterial->GetName());
}