Commit 46b64b45 authored by MURRAY David's avatar MURRAY David
Browse files

format

parent b5b698f8
Pipeline #256319 passed with stages
in 30 minutes and 17 seconds
......@@ -693,9 +693,9 @@ void OptixMaterialHandler::createMaterials(std::vector<std::string> const &cuda_
if (_mrf_materials[i])
#ifdef MRF_RENDERING_MODE_SPECTRAL
_materials[_mrf_materials[i]] = createMaterialFromMRF(_mrf_materials[i], cuda_compile_options, wavelengths);
_materials[_mrf_materials[i]] = createMaterialFromMRF(_mrf_materials[i], cuda_compile_options, wavelengths);
#else
_materials[_mrf_materials[i]] = createMaterialFromMRF(_mrf_materials[i], cuda_compile_options);
_materials[_mrf_materials[i]] = createMaterialFromMRF(_mrf_materials[i], cuda_compile_options);
#endif
//auto fresnel_mirror = dynamic_cast<mrf::materials::FresnelMirror *>(material);
......@@ -1371,7 +1371,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
auto multi_mat = dynamic_cast<mrf::materials::MultiMaterial *>(material);
if (multi_mat)
{
mrf_indices = multi_mat->getAllMRFId();
mrf_indices = multi_mat->getAllMRFId();
}
else
{
......
......@@ -209,7 +209,7 @@ bool SceneParser::parseGlobalMaterials(Scene &scene)
if (material)
{
_loger->trace("Materials Found ! Parsing them....");
for (; material; material = material->NextSiblingElement())
{
std::string element_name = material->Name();
......@@ -1228,20 +1228,19 @@ SceneParser::addMesh(XMLElement *a_mesh_element, mrf::rendering::Scene &scene, i
for (int i = 0; i < materials.size(); ++i)
{
uint index = 0;
while (multi_mat->getAllNames()[index] != materials[i].name() && index < multi_mat->getAllNames().size()-1)
while (multi_mat->getAllNames()[index] != materials[i].name() && index < multi_mat->getAllNames().size() - 1)
{
++index;
}
if (index < multi_mat->getAllNames().size())
remapping.push_back(index);
if (index < multi_mat->getAllNames().size()) remapping.push_back(index);
}
enforced_materials.resize(per_face_material.size());
#pragma omp parallel for schedule(static)
#pragma omp parallel for schedule(static)
for (int i = 0; i < enforced_materials.size(); ++i)
{
unsigned int prev = per_face_material[i];
unsigned int prev = per_face_material[i];
enforced_materials[i] = remapping[prev];
}
......@@ -1603,7 +1602,7 @@ bool SceneParser::addMaterial(XMLElement *a_mat_element, mrf::rendering::Scene &
unsigned int count;
int rOk = a_mat_element->QueryUnsignedAttribute(SceneLexer::COUNT_AT, &count);
MultiMaterial *multimat = new MultiMaterial(name, count);
bool rOK = parseMultiMaterial(a_mat_element, multimat, scene);
bool rOK = parseMultiMaterial(a_mat_element, multimat, scene);
if (rOK)
{
_brdf_map[name] = scene.addMaterial(multimat);
......@@ -1611,7 +1610,8 @@ bool SceneParser::addMaterial(XMLElement *a_mat_element, mrf::rendering::Scene &
}
else
{
_loger->warn("Something went wrong with a mutli-material. Please check that its material are in the scene graph.");
_loger->warn(
"Something went wrong with a mutli-material. Please check that its material are in the scene graph.");
delete multimat;
}
}
......@@ -2803,19 +2803,19 @@ bool SceneParser::parseMultiMaterial(
_loger->trace("Materials Found ! Parsing it....");
bool rOK = true;
bool rOK = true;
for (; material; material = material->NextSiblingElement())
{
std::string element_name = material->Name();
if (element_name.compare(SceneLexer::MATERIAL_MK) == 0)
{
std::string name(material->Attribute(SceneLexer::NAME_AT));
std::string name(material->Attribute(SceneLexer::NAME_AT));
/* if (_brdf_map.count(name) != 1)
rOK &= addMaterial(material, scene); */
/* if (_brdf_map.count(name) != 1)
rOK &= addMaterial(material, scene); */
//multi_mat->addEntry(_brdf_map[name], name);
multi_mat->addNameEntry(name);
}
}
......
......@@ -16,7 +16,6 @@ namespace materials
class MRF_CORE_EXPORT MultiMaterial: public BRDF
{
protected:
std::vector<unsigned int> _mrf_indices;
std::vector<std::string> _names;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment