mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
+ | Poorly done emissive texture
This commit is contained in:
@ -249,6 +249,7 @@ void ObjParser::parseMtl(std::stringstream &input_line, Scene &scene)
|
||||
mat = new Material;
|
||||
memset(mat, 0, sizeof(Material));
|
||||
mat->texture_index = -1;
|
||||
mat->emission_texture_index = -1;
|
||||
mat->refraction = 1.0f;
|
||||
mat->roughness = 1.0f;
|
||||
mat->metallic = 1.0f;
|
||||
@ -324,6 +325,16 @@ void ObjParser::parseMtl(std::stringstream &input_line, Scene &scene)
|
||||
mat->texture_index = scene.getTextures().size();
|
||||
scene.addTexture(getFilePath(_filename) + path);
|
||||
}
|
||||
else if (identifier == "map_Ke")
|
||||
{
|
||||
std::string path;
|
||||
|
||||
if (!(lineStream >> path))
|
||||
throw std::runtime_error("OBJ: syntax error while getting material texture");
|
||||
|
||||
mat->emission_texture_index = scene.getEmissionTextures().size();
|
||||
scene.addEmissionTexture(getFilePath(_filename) + path);
|
||||
}
|
||||
else
|
||||
std::cerr << "unsupported material setting : " << identifier << std::endl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user