More debugging of the FBXReader in order to understand how to interpret the material fields

This commit is contained in:
dev 2014-11-24 18:32:36 -08:00
parent 424e8457ec
commit ce103acdf6
2 changed files with 33 additions and 3 deletions

View file

@ -2347,8 +2347,12 @@ int Model::renderMeshesFromList(QVector<int>& list, gpu::Batch& batch, RenderMod
diffuseMap = (_dilatedTextures[i][j] =
static_cast<DilatableNetworkTexture*>(diffuseMap)->getDilatedTexture(_pupilDilation)).data();
}
GLBATCH(glBindTexture)(GL_TEXTURE_2D, !diffuseMap ?
Application::getInstance()->getTextureCache()->getWhiteTextureID() : diffuseMap->getID());
static bool showDiffuse = true;
if (showDiffuse && diffuseMap) {
GLBATCH(glBindTexture)(GL_TEXTURE_2D, diffuseMap->getID());
} else {
GLBATCH(glBindTexture)(GL_TEXTURE_2D, Application::getInstance()->getTextureCache()->getWhiteTextureID());
}
if (locations->texcoordMatrices >= 0) {
glm::mat4 texcoordTransform[2];
@ -2379,7 +2383,11 @@ int Model::renderMeshesFromList(QVector<int>& list, gpu::Batch& batch, RenderMod
if (locations->emissiveTextureUnit >= 0) {
assert(locations->emissiveParams >= 0); // we should have the emissiveParams defined in the shader
GLBATCH(glUniform2f)(locations->emissiveParams, 0.1f, 4.0f);
static float emissiveOffset = 0.1f;
static float emissiveScale = 1.0f;
//GLBATCH(glUniform2f)(locations->emissiveParams, 0.1f, 4.0f);
GLBATCH(glUniform2f)(locations->emissiveParams, emissiveOffset, emissiveScale);
GLBATCH(glActiveTexture)(GL_TEXTURE0 + locations->emissiveTextureUnit);
Texture* emissiveMap = networkPart.emissiveTexture.data();

View file

@ -1597,9 +1597,28 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
} else if (property.properties.at(0) == "Opacity") {
material.opacity = property.properties.at(index).value<double>();
}
#if defined(DEBUG_FBXREADER)
else {
const std::string propname = property.properties.at(0).toString().toStdString();
if (propname == "EmissiveFactor") {
}
}
#endif
}
}
}
#if defined(DEBUG_FBXREADER)
else {
std::string propname = subobject.name.data();
int unknown = 0;
if ( (propname == "Version")
||(propname == "ShadingModel")
||(propname == "Multilayer")) {
} else {
unknown++;
}
}
#endif
}
material.id = getID(object.properties);
materials.insert(material.id, material);
@ -1687,7 +1706,10 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
} else if (type.contains("emissive")) {
emissiveTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1));
} else if (type.contains("ambient")) {
emissiveTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1));
} else {
std::string typenam = type.data();
counter++;
}
}