From 5f01257ceea9643a29aea9eb8a7b43b6c0cc8b24 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Wed, 1 May 2013 17:54:48 -0700 Subject: [PATCH] Fixed bug that caused transparency values in FBX files to be imported incorrectly --- KREngine/kraken/KRResource+fbx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KREngine/kraken/KRResource+fbx.cpp b/KREngine/kraken/KRResource+fbx.cpp index a12ef48..cc19d67 100644 --- a/KREngine/kraken/KRResource+fbx.cpp +++ b/KREngine/kraken/KRResource+fbx.cpp @@ -937,7 +937,7 @@ void LoadMaterial(KRContext &context, std::vector &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 &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()); }