......@@ -74,11 +74,11 @@ add_subdirectory(sf2)
if(MIRRAGE_BUILD_MESH_CONVERTER)
find_package(assimp 4.1)
if(NOT assimp_FOUND)
# find_package(assimp 4.1)
# if(NOT assimp_FOUND)
add_subdirectory(assimp)
set_property(TARGET assimp PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/assimp/include" "${CMAKE_CURRENT_BINARY_DIR}/assimp/include")
endif()
# endif()
add_subdirectory(stb_image)
include(crunch_interface.cmake)
......
Subproject commit 80799bdbf90ce626475635815ee18537718a05b1
Subproject commit 83df4f41042fdc6d687c0738e489f8d65d1bdbd7
......@@ -28,11 +28,15 @@ namespace mirrage {
struct Mesh_converted_config {
Texture_mapping texture_mappings{
{Texture_type::albedo, {1}}, // aiTextureType_DIFFUSE
{Texture_type::metalness, {3}}, // aiTextureType_AMBIENT
{Texture_type::roughness, {7, 2}}, // aiTextureType_SHININESS, aiTextureType_SPECULAR
{Texture_type::normal, {6, 5}}, // aiTextureType_NORMALS, aiTextureType_HEIGHT
{Texture_type::emission, {4}}, // aiTextureType_EMISSIVE
{Texture_type::albedo, {1, 12}}, // aiTextureType_DIFFUSE, aiTextureType_BASE_COLOR
{Texture_type::metalness, {3, 15}}, // aiTextureType_AMBIENT, aiTextureType_METALNESS
{Texture_type::roughness,
{7,
2,
16}}, // aiTextureType_SHININESS, aiTextureType_SPECULAR, aiTextureType_DIFFUSE_ROUGHNESS
{Texture_type::normal,
{6, 13, 5}}, // aiTextureType_NORMALS, aiTextureType_NORMAL_CAMERA, aiTextureType_HEIGHT
{Texture_type::emission, {4, 14}}, // aiTextureType_EMISSIVE, aiTextureType_EMISSION_COLOR
};
std::unordered_map<std::string, std::unordered_map<Texture_type, std::string>>
......
......@@ -354,6 +354,12 @@ namespace mirrage {
auto material_file = renderer::Material_data{};
material_file.substance_id = util::Str_id("default"); // TODO: decide alpha-test / alpha-blend
for(auto i = std::size_t(0); i < material.mNumProperties; i++) {
auto m = material.mProperties[i];
LOG(plog::info) << "Mat " << m->mKey.C_Str() << " Index=" << m->mIndex
<< " Data=" << std::string(m->mData, m->mDataLength);
}
// convert albedo
auto albedo_name =
resolve_path(name, base_dir, find_texture(name, material, cfg, Texture_type::albedo));
......