This commit is contained in:
Xiao Qi 2022-11-11 13:18:51 +08:00
parent 418dcaebfd
commit 457094dc50
5 changed files with 5039 additions and 44 deletions

BIN
Racoon.shmodel Normal file

Binary file not shown.

View File

@ -1,14 +1,14 @@
AssimpInclude = "%{prj.location}\\Dependencies\\assimp"
-- outputdir = "%{wks.location}/bin/%{cfg.buildcfg}"
-- interdir = "%{wks.location}/bin_int"
-- workspace "ModelCompile"
-- architecture "x64"
-- configurations
-- {
-- "Release",
-- "Debug"
-- }
outputdir = "%{wks.location}/bin/%{cfg.buildcfg}"
interdir = "%{wks.location}/bin_int"
workspace "ModelCompile"
architecture "x64"
configurations
{
"Release",
"Debug"
}
project "ModelCompiler"
kind "ConsoleApp"

4993
racoon.gltf Normal file

File diff suppressed because one or more lines are too long

View File

@ -182,9 +182,9 @@ namespace SH_COMP
| aiProcess_FindInstances // search for instanced meshes and remove them by references to one master
| aiProcess_CalcTangentSpace // calculate tangents and bitangents if possible
| aiProcess_JoinIdenticalVertices // join identical vertices/ optimize indexing
| aiProcess_RemoveRedundantMaterials // remove redundant materials
| aiProcess_FindInvalidData // detect invalid model data, such as invalid normal vectors
| aiProcess_FlipUVs // flip the V to match the Vulkans way of doing UVs
| aiProcess_ValidateDataStructure
);
if (!scene || !scene->HasMeshes())

View File

@ -16,42 +16,44 @@
int main(int argc, char* argv[])
{
std::vector<std::string> paths;
//std::vector<std::string> paths;
if (argc == 1)
{
if (std::filesystem::is_directory(ASSET_ROOT))
{
for (auto& dir :
std::filesystem::recursive_directory_iterator{ ASSET_ROOT })
{
if (dir.path().extension().string() == GLTF_EXTENSION ||
dir.path().extension().string() == FBX_EXTENSION)
{
auto path = dir.path();
path.make_preferred();
paths.push_back(path.string());
}
}
}
else
{
std::cout << "Default path not found!" << std::endl;
return 1;
}
}
else if (argc > 1)
{
for (int i { 1 }; i < argc; ++i)
{
paths.emplace_back(argv[i]);
}
}
//if (argc == 1)
//{
// if (std::filesystem::is_directory(ASSET_ROOT))
// {
// for (auto& dir :
// std::filesystem::recursive_directory_iterator{ ASSET_ROOT })
// {
// if (dir.path().extension().string() == GLTF_EXTENSION ||
// dir.path().extension().string() == FBX_EXTENSION)
// {
// auto path = dir.path();
// path.make_preferred();
// paths.push_back(path.string());
// }
// }
// }
// else
// {
// std::cout << "Default path not found!" << std::endl;
// return 1;
// }
//}
//else if (argc > 1)
//{
// for (int i { 1 }; i < argc; ++i)
// {
// paths.emplace_back(argv[i]);
// }
//}
for (auto const& path : paths)
{
SH_COMP::MeshCompiler::LoadAndCompile(path);
}
//for (auto const& path : paths)
//{
// SH_COMP::MeshCompiler::LoadAndCompile(path);
//}
SH_COMP::MeshCompiler::LoadAndCompile("Racoon.gltf");
return 0;
}