Added support for parameters Ni and Tf in OBJ/MTL file format.

This commit is contained in:
Henryk Blasinski
2017-01-12 17:11:17 -08:00
parent 69052812f5
commit 17cae8ac5a
5 changed files with 25 additions and 4 deletions

View File

@@ -166,11 +166,18 @@ void ObjExporter::WriteMaterialFile()
if(AI_SUCCESS == mat->Get(AI_MATKEY_COLOR_EMISSIVE,c)) {
mOutputMat << "Ke " << c.r << " " << c.g << " " << c.b << endl;
}
if(AI_SUCCESS == mat->Get(AI_MATKEY_COLOR_TRANSPARENT,c)) {
mOutputMat << "Tf " << c.r << " " << c.g << " " << c.b << endl;
}
ai_real o;
if(AI_SUCCESS == mat->Get(AI_MATKEY_OPACITY,o)) {
mOutputMat << "d " << o << endl;
}
if(AI_SUCCESS == mat->Get(AI_MATKEY_REFRACTI,o)) {
mOutputMat << "Ni " << o << endl;
}
if(AI_SUCCESS == mat->Get(AI_MATKEY_SHININESS,o) && o) {
mOutputMat << "Ns " << o << endl;