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 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<ImportedMaterialTexture> Textures { get; set; }
}

View File

@ -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;
}
}

View File

@ -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;
}
}