mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 10:48:34 +02:00
+ | Better random
This commit is contained in:
@ -76,8 +76,8 @@ void Scene::updateGPUData()
|
||||
gpu_obj.color = mat->color;
|
||||
gpu_obj.emission = mat->emission;
|
||||
gpu_obj.roughness = mat->roughness;
|
||||
gpu_obj.specular = mat->specular;
|
||||
|
||||
gpu_obj.metallic = mat->metallic;
|
||||
|
||||
gpu_obj.type = static_cast<int>(obj->getType());
|
||||
|
||||
if (obj->getType() == Object::Type::SPHERE)
|
||||
|
@ -38,10 +38,10 @@ void SceneParser::parseMaterial(std::stringstream &line)
|
||||
float r,g,b;
|
||||
float emission;
|
||||
float roughness;
|
||||
float specular;
|
||||
float metallic;
|
||||
Material *mat;
|
||||
|
||||
if (!(line >> r >> g >> b >> emission >> roughness >> specular))
|
||||
if (!(line >> r >> g >> b >> emission >> roughness >> metallic))
|
||||
throw std::runtime_error("Material: Missing material properties");
|
||||
|
||||
mat = new Material;
|
||||
@ -49,7 +49,7 @@ void SceneParser::parseMaterial(std::stringstream &line)
|
||||
mat->color = glm::vec3(r / 255.0f, g / 255.0f, b / 255.0f);
|
||||
mat->emission = emission;
|
||||
mat->roughness = roughness;
|
||||
mat->specular = specular;
|
||||
mat->metallic = metallic;
|
||||
|
||||
_scene->addMaterial(mat);
|
||||
}
|
||||
|
Reference in New Issue
Block a user