+ | Lambo scene

This commit is contained in:
TheRedShip
2025-01-30 23:17:07 +01:00
parent 28ba1a1dd0
commit d94de1954f
14 changed files with 948368 additions and 2261140 deletions

View File

@ -251,6 +251,7 @@ void ObjParser::parseMtl(std::stringstream &input_line, Scene &scene)
mat->texture_index = -1;
mat->refraction = 1.0f;
mat->roughness = 1.0f;
mat->metallic = 1.0f;
continue;
}
if(!mat)
@ -266,6 +267,18 @@ void ObjParser::parseMtl(std::stringstream &input_line, Scene &scene)
throw std::runtime_error("OBJ: syntax error while getting material softness");
mat->roughness /= 1000;
}
else if (identifier == "Pr")
{
if (!(lineStream >> mat->roughness) || mat->roughness > 1 || mat->roughness < 0)
throw std::runtime_error("OBJ: syntax error while getting material softness");
mat->roughness = 1 - mat->roughness;
}
else if (identifier == "Pm")
{
if (!(lineStream >> mat->metallic) || mat->metallic > 1 || mat->metallic < 0)
throw std::runtime_error("OBJ: syntax error while getting material metallic");
}
else if(identifier == "Ke")
{
float x, y, z;