+ | Refraction index dieletric material

This commit is contained in:
TheRedShip
2025-01-06 12:15:03 +01:00
parent 00af3314d8
commit 5a6fd1f9ef
8 changed files with 85 additions and 13 deletions

View File

@ -45,17 +45,23 @@ void SceneParser::parseMaterial(std::stringstream &line)
float emission;
float roughness;
float metallic;
int type;
Material *mat;
if (!(line >> r >> g >> b >> emission >> roughness >> metallic))
throw std::runtime_error("Material: Missing material properties");
if (!(line >> type))
type = 0;
mat = new Material;
mat->color = glm::vec3(r / 255.0f, g / 255.0f, b / 255.0f);
mat->emission = emission;
mat->roughness = roughness;
mat->metallic = metallic;
mat->type = type;
_scene->addMaterial(mat);
}