SpecularFactor import and export improvements

The changes here (which only apply to reading from or writing to pbrSpecularGlossiness) will:

- store and read specular color on `AI_MATKEY_COLOR_SPECULAR ` rather than `AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_SPECULAR_FACTOR`
- store and read specular texture from `aiTextureType_SPECULAR` rather than `AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_SPECULARGLOSSINESS_TEXTURE`. Even though pbrSG’s specularGlossiness texture uses the alpha channel for glossiness, it will still work well enough with just the RGB channels of the image
This commit is contained in:
Daniel Hritzkiv
2017-10-19 12:24:25 -04:00
parent c71790c78d
commit a898c1f2d1
3 changed files with 6 additions and 6 deletions

View File

@@ -470,11 +470,11 @@ void glTF2Exporter::ExportMaterials()
PbrSpecularGlossiness pbrSG;
GetMatColor(mat, pbrSG.specularFactor, AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_SPECULAR_FACTOR);
mat->Get(AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_GLOSSINESS_FACTOR, pbrSG.glossinessFactor);
GetMatTex(mat, pbrSG.specularGlossinessTexture, AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_SPECULARGLOSSINESS_TEXTURE);
GetMatColor(mat, pbrSG.diffuseFactor, AI_MATKEY_COLOR_DIFFUSE);
GetMatColor(mat, pbrSG.specularFactor, AI_MATKEY_COLOR_SPECULAR);
GetMatTex(mat, pbrSG.diffuseTexture, aiTextureType_DIFFUSE);
GetMatTex(mat, pbrSG.specularGlossinessTexture, aiTextureType_SPECULAR);
m->pbrSpecularGlossiness = Nullable<PbrSpecularGlossiness>(pbrSG);
}