Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

Commit ac98158e authored by MURRAY David's avatar MURRAY David
Browse files

need to check meshes

parent 12cadae9
......@@ -248,10 +248,10 @@ std::vector<std::pair<OptiXMesh, mrf::geom::Shape *>> &OptixGeometryHandler::geo
}
void OptixGeometryHandler::loadMeshFromMRF(
mrf::geom::Mesh const & mrf_mesh,
OptiXMesh & optix_mesh,
const optix::Matrix4x4 &load_xform,
std::vector<optix::Material> optix_materials)
mrf::geom::Mesh const & mrf_mesh,
OptiXMesh & optix_mesh,
const optix::Matrix4x4 & load_xform,
std::vector<optix::Material> optix_materials)
{
if (!optix_mesh.context)
{
......@@ -271,7 +271,7 @@ void OptixGeometryHandler::loadMeshFromMRF(
if (mrf_mesh.uvs().size() == mrf_mesh.vertices().size()) mesh.has_texcoords = true;
if (mrf_mesh.tangents().size() == mrf_mesh.vertices().size()) mesh.has_tangents = true;
mesh.num_materials = 0;
mesh.num_materials = optix_materials.size();
setupMeshLoaderInputs(context, buffers, mesh);
......@@ -309,7 +309,7 @@ void OptixGeometryHandler::loadMeshFromMRF(
//std::copy(mrf_mesh.faces().cbegin(), mrf_mesh.faces().cend(), mesh.tri_indices);
memcpy(mesh.tri_indices, &mrf_mesh.faces()[0], mrf_mesh.faces().size() * sizeof(unsigned int));
memcpy(mesh.mat_indices, &mrf_mesh.materialPerFaces()[0], mrf_mesh.materialPerFaces().size() * sizeof(unsigned int));
applyLoadXForm(mesh, load_xform.getData());
......@@ -327,10 +327,13 @@ void OptixGeometryHandler::loadMeshFromMRF(
memset(mesh.mat_indices, 0, mesh.num_triangles * sizeof(int32_t));
//optix_materials.push_back(optix_mesh.material);
}
//else
//{
// optix_materials.resize(nb_mat);
//}
else
{
memcpy(
mesh.mat_indices,
&mrf_mesh.materialPerFaces()[0],
mrf_mesh.materialPerFaces().size() * sizeof(unsigned int));
}
optix::GeometryTriangles geometry = optix_mesh.context->createGeometryTriangles();
......
......@@ -921,8 +921,8 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance["registered_as_light"]->setInt(0);
geom_instance->setMaterial(mesh_indices[i], _diffuse_emittance);
return;
geom_instance->setMaterial(i, _diffuse_emittance);
continue;
}
auto lambert = dynamic_cast<mrf::materials::Lambert *>(material);
......@@ -944,8 +944,8 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance["repeat"]->setFloat(0.f);
geom_instance->setMaterial(mesh_indices[i], _lambert);
return;
geom_instance->setMaterial(0, _lambert);
continue;
}
auto checkerboard = dynamic_cast<mrf::materials::CheckerBoard *>(material);
......@@ -968,7 +968,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance->setMaterial(mesh_indices[i], _lambert);
return;
continue;
}
auto fresnel_mirror = dynamic_cast<mrf::materials::FresnelMirror *>(material);
......@@ -999,7 +999,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_distribution"]->setInt(0); //HARDCODED FOR NOW: 0 = GGX distribution.
geom_instance["_is_conductor"]->setInt(1); //HARDCODED FOR NOW: 1 = true.
geom_instance->setMaterial(mesh_indices[i], _microfacet_conductor);
return;
continue;
}
auto fresnel_glass = dynamic_cast<mrf::materials::FresnelGlass *>(material);
......@@ -1046,7 +1046,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_distribution"]->setInt(0); //HARDCODED FOR NOW: 0 = GGX distribution.
geom_instance["_is_conductor"]->setInt(0); //HARDCODED FOR NOW: 0 = false.
geom_instance->setMaterial(mesh_indices[i], _microfacet_dielectric);
return;
continue;
}
auto walter_glass = dynamic_cast<mrf::materials::_WalterBSDF<mrf::materials::GGX> *>(material);
......@@ -1086,7 +1086,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_is_conductor"]->setInt(0); //HARDCODED FOR NOW: 0 = false.
geom_instance["_thickness"]->setFloat(0.f);
geom_instance->setMaterial(mesh_indices[i], _microfacet_dielectric);
return;
continue;
}
auto mirror = dynamic_cast<mrf::materials::PerfectMirror *>(material);
......@@ -1117,7 +1117,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_distribution"]->setInt(0); //HARDCODED FOR NOW: 0 = GGX distribution.
geom_instance["_is_conductor"]->setInt(1); //HARDCODED FOR NOW: 1 = true.
geom_instance->setMaterial(mesh_indices[i], _microfacet_conductor);
return;
continue;
}
auto ggx = dynamic_cast<mrf::materials::GGX *>(material);
......@@ -1147,7 +1147,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_distribution"]->setInt(0); //HARDCODED FOR NOW: 0 = GGX distribution.
geom_instance["_is_conductor"]->setInt(1); //HARDCODED FOR NOW: 1 = true.
geom_instance->setMaterial(mesh_indices[i], _microfacet_conductor);
return;
continue;
}
auto measured = dynamic_cast<mrf::materials::MeasuredIsotropic *>(material);
......@@ -1159,7 +1159,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
if (_measured_materials_buffer.find(material) == _measured_materials_buffer.end())
{
_loger.fatal("Cannot find material buffer for Measured Isotropic buffer in applyMaterial() !");
return;
continue;
}
auto &buffer = _measured_materials_buffer[material].first;
......@@ -1169,7 +1169,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["brdf_data"]->set(buffer);
geom_instance["brdf_data_dirac"]->set(buffer_dirac);
geom_instance->setMaterial(mesh_indices[i], _measured_isotropic);
return;
continue;
}
auto phong_textured = dynamic_cast<mrf::materials::LPhysicalPhongTextured *>(material);
......@@ -1235,7 +1235,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance->setMaterial(mesh_indices[i], _phong);
return;
continue;
}
auto phong = dynamic_cast<mrf::materials::LPhysicalPhong *>(material);
......@@ -1264,7 +1264,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance->setMaterial(mesh_indices[i], _phong);
return;
continue;
}
auto principled = dynamic_cast<mrf::materials::PrincipledDisney *>(material);
......@@ -1293,7 +1293,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance->setMaterial(mesh_indices[i], _principled);
return;
continue;
}
auto normal_mat = dynamic_cast<mrf::materials::NormalShader *>(material);
......@@ -1302,7 +1302,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance["_debug_type"]->setInt(1);
geom_instance->setMaterial(mesh_indices[i], _debug_shader);
return;
continue;
}
auto tangent_mat = dynamic_cast<mrf::materials::TangentShader *>(material);
......@@ -1311,7 +1311,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance["_debug_type"]->setInt(2);
geom_instance->setMaterial(mesh_indices[i], _debug_shader);
return;
continue;
}
auto uv_mat = dynamic_cast<mrf::materials::UVShader *>(material);
......@@ -1320,7 +1320,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance["_debug_type"]->setInt(3);
geom_instance->setMaterial(mesh_indices[i], _debug_shader);
return;
continue;
}
auto flat_mat = dynamic_cast<mrf::materials::FlatBRDF *>(material);
......@@ -1329,7 +1329,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
geom_instance["_thickness"]->setFloat(0.f);
geom_instance["_debug_type"]->setInt(0);
geom_instance->setMaterial(mesh_indices[i], _debug_shader);
return;
continue;
}
auto shadow_catcher_mat = dynamic_cast<mrf::materials::ShadowCatcher *>(material);
......@@ -1337,7 +1337,7 @@ void OptixMaterialHandler::applyMaterial(/*OptiXMesh &optix_mesh,*/
{
geom_instance["_thickness"]->setFloat(0.f);
geom_instance->setMaterial(mesh_indices[i], _shadow_catcher);
return;
continue;
}
}
}
......
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