Add support for parsing map_Bump in mtl.

This commit is contained in:
Syoyo Fujita
2017-08-20 18:30:54 +09:00
parent be46318a52
commit 785af4491d
4 changed files with 857 additions and 1 deletions

View File

@@ -585,6 +585,26 @@ TEST_CASE("refl", "[refl]") {
REQUIRE(materials[0].reflection_texname.compare("reflection.tga") == 0);
}
TEST_CASE("map_Bump", "[bump]") {
tinyobj::attrib_t attrib;
std::vector<tinyobj::shape_t> shapes;
std::vector<tinyobj::material_t> materials;
std::string err;
bool ret = tinyobj::LoadObj(&attrib, &shapes, &materials, &err, "../models/map-bump.obj", gMtlBasePath);
if (!err.empty()) {
std::cerr << err << std::endl;
}
PrintInfo(attrib, shapes, materials);
REQUIRE(true == ret);
REQUIRE(2 == materials.size());
REQUIRE(materials[0].bump_texname.compare("bump.jpg") == 0);
}
#if 0
int
main(