20 template<
typename HalfedgeGraph,
26 const GeometryTraits &)
29 auto it = mtl_pm.storage_begin();
30 auto it_end = mtl_pm.storage_end();
31 for(; it != it_end; ++it)
34 std::cout <<
"processing material '" << material.name <<
"'" << std::endl;
37 for(
const auto &texture_filename : { material.ambient_texture_filename,
38 material.diffuse_texture_filename,
39 material.specular_texture_filename,
40 material.emissive_texture_filename,
41 material.transparency_texture_filename,
42 material.normal_map_filename,
43 material.metallic_map_filename,
44 material.roughness_map_filename })
46 if(texture_filename.empty())
51 auto &cimg = *(material.images.at(texture_filename));
55 if(cimg.spectrum() < 3)
57 std::cout <<
" skipping non RGB texture '" << texture_filename <<
"'"
64 std::cout <<
" processing texture '" << texture_filename <<
"'"
69 for(
int row = 0; row < cimg.height(); row++)
71 for(
int col = 0; col < cimg.width(); col++)
73 auto R = cimg(col, row, 0, 0);
74 auto G = cimg(col, row, 0, 1);
75 auto B = cimg(col, row, 0, 2);
77 cimg(col, row, 0, 0) = B;
78 cimg(col, row, 0, 1) = R;
79 cimg(col, row, 0, 2) =
G;
88 template<
typename HalfedgeGraph,