mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 17:53:32 +02:00
ke is the new ka
This commit is contained in:
parent
188e476f2f
commit
dee06e72f6
2 changed files with 12 additions and 8 deletions
|
@ -277,9 +277,9 @@ void OBJReader::parseMaterialLibrary(QIODevice* device) {
|
|||
#ifdef WANT_DEBUG
|
||||
qCDebug(modelformat) << "OBJ Reader Starting new material definition " << matName;
|
||||
#endif
|
||||
//currentMaterial.emissiveTextureFilename = "";
|
||||
currentMaterial.diffuseTextureFilename = "";
|
||||
//currentMaterial.specularTextureFilename = "";
|
||||
currentMaterial.emissiveTextureFilename = "";
|
||||
currentMaterial.specularTextureFilename = "";
|
||||
} else if (token == "Ns") {
|
||||
currentMaterial.shininess = tokenizer.getFloat();
|
||||
} else if (token == "d") {
|
||||
|
@ -287,12 +287,16 @@ void OBJReader::parseMaterialLibrary(QIODevice* device) {
|
|||
} else if (token == "Tr") {
|
||||
currentMaterial.opacity = 1.0f - tokenizer.getFloat();
|
||||
} else if (token == "Ka") {
|
||||
currentMaterial.emissiveColor = tokenizer.getVec3();
|
||||
#ifdef WANT_DEBUG
|
||||
qCDebug(modelformat) << "OBJ Reader Ignoring material Ka " << tokenizer.getVec3();
|
||||
#endif
|
||||
} else if (token == "Kd") {
|
||||
currentMaterial.diffuseColor = tokenizer.getVec3();
|
||||
} else if (token == "Ke") {
|
||||
currentMaterial.emissiveColor = tokenizer.getVec3();
|
||||
} else if (token == "Ks") {
|
||||
currentMaterial.specularColor = tokenizer.getVec3();
|
||||
} else if ((token == "map_Ka") || (token == "map_Kd") || (token == "map_Ks")) {
|
||||
} else if ((token == "map_Kd") || (token == "map_Ke") || (token == "map_Ks")) {
|
||||
QByteArray filename = QUrl(tokenizer.getLineAsDatum()).fileName().toUtf8();
|
||||
if (filename.endsWith(".tga")) {
|
||||
#ifdef WANT_DEBUG
|
||||
|
@ -300,10 +304,10 @@ void OBJReader::parseMaterialLibrary(QIODevice* device) {
|
|||
#endif
|
||||
break;
|
||||
}
|
||||
if (token == "map_Ka") {
|
||||
currentMaterial.emissiveTextureFilename = filename;
|
||||
} else if (token == "map_Kd") {
|
||||
if (token == "map_Kd") {
|
||||
currentMaterial.diffuseTextureFilename = filename;
|
||||
} else if (token == "map_Ke") {
|
||||
currentMaterial.emissiveTextureFilename = filename;
|
||||
} else if( token == "map_Ks" ) {
|
||||
currentMaterial.specularTextureFilename = filename;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
QByteArray emissiveTextureFilename;
|
||||
bool used { false };
|
||||
bool userSpecifiesUV { false };
|
||||
OBJMaterial() : shininess(0.0f), opacity(1.0f), diffuseColor(0.9f), specularColor(0.9f), emissiveColor(0.9f) {}
|
||||
OBJMaterial() : shininess(0.0f), opacity(1.0f), diffuseColor(0.9f), specularColor(0.9f), emissiveColor(0.0f) {}
|
||||
};
|
||||
|
||||
class OBJReader: public QObject { // QObject so we can make network requests.
|
||||
|
|
Loading…
Reference in a new issue