fixed OBJ material gamma correction issue introduced in a prior commit
parent
b499ef8772
commit
fa95593651
|
@ -393,7 +393,8 @@ public:
|
||||||
|
|
||||||
Texture *loadTexture(const FileResolver *fileResolver,
|
Texture *loadTexture(const FileResolver *fileResolver,
|
||||||
std::map<std::string, Texture *> &cache,
|
std::map<std::string, Texture *> &cache,
|
||||||
const fs::path &mtlPath, std::string filename) {
|
const fs::path &mtlPath, std::string filename,
|
||||||
|
bool noGamma = false) {
|
||||||
/* Prevent Linux/OSX fs::path handling issues for DAE files created on Windows */
|
/* Prevent Linux/OSX fs::path handling issues for DAE files created on Windows */
|
||||||
for (size_t i=0; i<filename.length(); ++i) {
|
for (size_t i=0; i<filename.length(); ++i) {
|
||||||
if (filename[i] == '\\')
|
if (filename[i] == '\\')
|
||||||
|
@ -414,6 +415,7 @@ public:
|
||||||
}
|
}
|
||||||
Properties props("bitmap");
|
Properties props("bitmap");
|
||||||
props.setString("filename", path.string());
|
props.setString("filename", path.string());
|
||||||
|
if (noGamma)
|
||||||
props.setFloat("gamma", 1.0f);
|
props.setFloat("gamma", 1.0f);
|
||||||
ref<Texture> texture = static_cast<Texture *> (PluginManager::getInstance()->
|
ref<Texture> texture = static_cast<Texture *> (PluginManager::getInstance()->
|
||||||
createObject(MTS_CLASS(Texture), props));
|
createObject(MTS_CLASS(Texture), props));
|
||||||
|
@ -484,7 +486,7 @@ public:
|
||||||
} else if (buf == "bump") {
|
} else if (buf == "bump") {
|
||||||
std::string filename;
|
std::string filename;
|
||||||
iss >> filename;
|
iss >> filename;
|
||||||
bump = loadTexture(fileResolver, cache, mtlPath, filename);
|
bump = loadTexture(fileResolver, cache, mtlPath, filename, true);
|
||||||
} else if (buf == "map_d") {
|
} else if (buf == "map_d") {
|
||||||
std::string filename;
|
std::string filename;
|
||||||
iss >> filename;
|
iss >> filename;
|
||||||
|
|
Loading…
Reference in New Issue