|
@@ -2126,7 +2126,12 @@ void FBXConverter::SetShadingPropertiesCommon(aiMaterial *out_mat, const Propert
|
|
|
const aiColor3D &Emissive = GetColorPropertyFromMaterial(props, "Emissive", ok);
|
|
|
if (ok) {
|
|
|
out_mat->AddProperty(&Emissive, 1, AI_MATKEY_COLOR_EMISSIVE);
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ const aiColor3D &emissiveColor = GetColorPropertyFromMaterial(props, "Maya|emissive", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&emissiveColor, 1, AI_MATKEY_COLOR_EMISSIVE);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
const aiColor3D &Ambient = GetColorPropertyFromMaterial(props, "Ambient", ok);
|
|
|
if (ok) {
|
|
@@ -2207,6 +2212,52 @@ void FBXConverter::SetShadingPropertiesCommon(aiMaterial *out_mat, const Propert
|
|
|
if (ok) {
|
|
|
out_mat->AddProperty(&DispFactor, 1, "$mat.displacementscaling", 0, 0);
|
|
|
}
|
|
|
+
|
|
|
+ // PBR material information
|
|
|
+ const aiColor3D &baseColor = GetColorPropertyFromMaterial(props, "Maya|base_color", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&baseColor, 1, AI_MATKEY_BASE_COLOR);
|
|
|
+ }
|
|
|
+
|
|
|
+ const float useColorMap = PropertyGet<float>(props, "Maya|use_color_map", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&useColorMap, 1, AI_MATKEY_USE_COLOR_MAP);
|
|
|
+ }
|
|
|
+
|
|
|
+ const float useMetallicMap = PropertyGet<float>(props, "Maya|use_metallic_map", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&useMetallicMap, 1, AI_MATKEY_USE_METALLIC_MAP);
|
|
|
+ }
|
|
|
+
|
|
|
+ const float metallicFactor = PropertyGet<float>(props, "Maya|metallic", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&metallicFactor, 1, AI_MATKEY_METALLIC_FACTOR);
|
|
|
+ }
|
|
|
+
|
|
|
+ const float useRoughnessMap = PropertyGet<float>(props, "Maya|use_roughness_map", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&useRoughnessMap, 1, AI_MATKEY_USE_ROUGHNESS_MAP);
|
|
|
+ }
|
|
|
+
|
|
|
+ const float roughnessFactor = PropertyGet<float>(props, "Maya|roughness", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&roughnessFactor, 1, AI_MATKEY_ROUGHNESS_FACTOR);
|
|
|
+ }
|
|
|
+
|
|
|
+ const float useEmissiveMap = PropertyGet<float>(props, "Maya|use_emissive_map", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&useEmissiveMap, 1, AI_MATKEY_USE_EMISSIVE_MAP);
|
|
|
+ }
|
|
|
+
|
|
|
+ const float emissiveIntensity = PropertyGet<float>(props, "Maya|emissive_intensity", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&emissiveIntensity, 1, AI_MATKEY_EMISSIVE_INTENSITY);
|
|
|
+ }
|
|
|
+
|
|
|
+ const float useAOMap = PropertyGet<float>(props, "Maya|use_ao_map", ok);
|
|
|
+ if (ok) {
|
|
|
+ out_mat->AddProperty(&useAOMap, 1, AI_MATKEY_USE_AO_MAP);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void FBXConverter::SetShadingPropertiesRaw(aiMaterial *out_mat, const PropertyTable &props, const TextureMap &_textures, const MeshGeometry *const mesh) {
|