small improved

This commit is contained in:
Perfare 2018-12-24 17:31:35 +08:00
parent e602a5cf3b
commit 54ed3971a2
3 changed files with 17 additions and 13 deletions

View File

@ -167,7 +167,9 @@ namespace AssetStudio
public Color4 Ambient { get; set; } public Color4 Ambient { get; set; }
public Color4 Specular { get; set; } public Color4 Specular { get; set; }
public Color4 Emissive { 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<ImportedMaterialTexture> Textures { get; set; } public List<ImportedMaterialTexture> Textures { get; set; }
} }

View File

@ -455,7 +455,7 @@ namespace AssetStudio
Color4 ambient = mat->Ambient; Color4 ambient = mat->Ambient;
Color4 emissive = mat->Emissive; Color4 emissive = mat->Emissive;
Color4 specular = mat->Specular; Color4 specular = mat->Specular;
float specularPower = mat->Power; Color4 reflection = mat->Reflection;
pMat = FbxSurfacePhong::Create(pScene, pMatName); pMat = FbxSurfacePhong::Create(pScene, pMatName);
pMat->Diffuse.Set(FbxDouble3(diffuse.Red, diffuse.Green, diffuse.Blue)); pMat->Diffuse.Set(FbxDouble3(diffuse.Red, diffuse.Green, diffuse.Blue));
pMat->DiffuseFactor.Set(FbxDouble(diffuse.Alpha)); pMat->DiffuseFactor.Set(FbxDouble(diffuse.Alpha));
@ -465,9 +465,11 @@ namespace AssetStudio
pMat->EmissiveFactor.Set(FbxDouble(emissive.Alpha)); pMat->EmissiveFactor.Set(FbxDouble(emissive.Alpha));
pMat->Specular.Set(FbxDouble3(specular.Red, specular.Green, specular.Blue)); pMat->Specular.Set(FbxDouble3(specular.Red, specular.Green, specular.Blue));
pMat->SpecularFactor.Set(FbxDouble(specular.Alpha)); 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); pMat->ShadingModel.Set(lShadingName);
foundMat = pMaterials->GetCount(); foundMat = pMaterials->GetCount();
pMaterials->Add(pMat); pMaterials->Add(pMat);
} }
@ -488,10 +490,10 @@ namespace AssetStudio
} }
else if (texture->Dest == 1) else if (texture->Dest == 1)
{ {
FbxFileTexture* pTextureEmissive = ExportTexture(ImportedHelpers::FindTexture(texture->Name, imported->TextureList)); FbxFileTexture* pTextureNormalMap = ExportTexture(ImportedHelpers::FindTexture(texture->Name, imported->TextureList));
if (pTextureEmissive != NULL) if (pTextureNormalMap != NULL)
{ {
LinkTexture(texture, pTextureEmissive, pMat->Emissive); LinkTexture(texture, pTextureNormalMap, pMat->NormalMap);
hasTexture = true; hasTexture = true;
} }
} }

View File

@ -563,12 +563,12 @@ namespace AssetStudio
case "_EmissionColor": case "_EmissionColor":
iMat.Emissive = col.Value; iMat.Emissive = col.Value;
break; break;
case "_SpecularColor":
case "_SpecColor": case "_SpecColor":
iMat.Specular = col.Value; iMat.Specular = col.Value;
break; break;
case "_RimColor": case "_ReflectColor":
case "_OutlineColor": iMat.Reflection = col.Value;
case "_ShadowColor":
break; break;
} }
} }
@ -578,10 +578,10 @@ namespace AssetStudio
switch (flt.Key) switch (flt.Key)
{ {
case "_Shininess": case "_Shininess":
iMat.Power = flt.Value; iMat.Shininess = flt.Value;
break; break;
case "_RimPower": case "_Transparency":
case "_Outline": iMat.Transparency = flt.Value;
break; break;
} }
} }