From 54ed3971a279e4b4471069ba1d1622170bcb103f Mon Sep 17 00:00:00 2001 From: Perfare Date: Mon, 24 Dec 2018 17:31:35 +0800 Subject: [PATCH] small improved --- AssetStudio/IImported.cs | 4 +++- AssetStudioFBX/AssetStudioFBXExporter.cpp | 14 ++++++++------ AssetStudioUtility/ModelConverter.cs | 12 ++++++------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/AssetStudio/IImported.cs b/AssetStudio/IImported.cs index e7d0db7..16087af 100644 --- a/AssetStudio/IImported.cs +++ b/AssetStudio/IImported.cs @@ -167,7 +167,9 @@ namespace AssetStudio public Color4 Ambient { get; set; } public Color4 Specular { get; set; } public Color4 Emissive { get; set; } - public float Power { get; set; } + public Color4 Reflection { get; set; } + public float Shininess { get; set; } + public float Transparency { get; set; } public List Textures { get; set; } } diff --git a/AssetStudioFBX/AssetStudioFBXExporter.cpp b/AssetStudioFBX/AssetStudioFBXExporter.cpp index 3fbe8f2..b8724d7 100644 --- a/AssetStudioFBX/AssetStudioFBXExporter.cpp +++ b/AssetStudioFBX/AssetStudioFBXExporter.cpp @@ -455,7 +455,7 @@ namespace AssetStudio Color4 ambient = mat->Ambient; Color4 emissive = mat->Emissive; Color4 specular = mat->Specular; - float specularPower = mat->Power; + Color4 reflection = mat->Reflection; pMat = FbxSurfacePhong::Create(pScene, pMatName); pMat->Diffuse.Set(FbxDouble3(diffuse.Red, diffuse.Green, diffuse.Blue)); pMat->DiffuseFactor.Set(FbxDouble(diffuse.Alpha)); @@ -465,9 +465,11 @@ namespace AssetStudio pMat->EmissiveFactor.Set(FbxDouble(emissive.Alpha)); pMat->Specular.Set(FbxDouble3(specular.Red, specular.Green, specular.Blue)); pMat->SpecularFactor.Set(FbxDouble(specular.Alpha)); - pMat->Shininess.Set(specularPower); + pMat->Reflection.Set(FbxDouble3(reflection.Red, reflection.Green, reflection.Blue)); + pMat->ReflectionFactor.Set(FbxDouble(reflection.Alpha)); + pMat->Shininess.Set(FbxDouble(mat->Shininess)); + pMat->TransparencyFactor.Set(FbxDouble(mat->Transparency)); pMat->ShadingModel.Set(lShadingName); - foundMat = pMaterials->GetCount(); pMaterials->Add(pMat); } @@ -488,10 +490,10 @@ namespace AssetStudio } else if (texture->Dest == 1) { - FbxFileTexture* pTextureEmissive = ExportTexture(ImportedHelpers::FindTexture(texture->Name, imported->TextureList)); - if (pTextureEmissive != NULL) + FbxFileTexture* pTextureNormalMap = ExportTexture(ImportedHelpers::FindTexture(texture->Name, imported->TextureList)); + if (pTextureNormalMap != NULL) { - LinkTexture(texture, pTextureEmissive, pMat->Emissive); + LinkTexture(texture, pTextureNormalMap, pMat->NormalMap); hasTexture = true; } } diff --git a/AssetStudioUtility/ModelConverter.cs b/AssetStudioUtility/ModelConverter.cs index 2a257a7..17fc5b1 100644 --- a/AssetStudioUtility/ModelConverter.cs +++ b/AssetStudioUtility/ModelConverter.cs @@ -563,12 +563,12 @@ namespace AssetStudio case "_EmissionColor": iMat.Emissive = col.Value; break; + case "_SpecularColor": case "_SpecColor": iMat.Specular = col.Value; break; - case "_RimColor": - case "_OutlineColor": - case "_ShadowColor": + case "_ReflectColor": + iMat.Reflection = col.Value; break; } } @@ -578,10 +578,10 @@ namespace AssetStudio switch (flt.Key) { case "_Shininess": - iMat.Power = flt.Value; + iMat.Shininess = flt.Value; break; - case "_RimPower": - case "_Outline": + case "_Transparency": + iMat.Transparency = flt.Value; break; } }