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" AssimpInclude = "%{prj.location}\\Dependencies\\assimp"
-- outputdir = "%{wks.location}/bin/%{cfg.buildcfg}" outputdir = "%{wks.location}/bin/%{cfg.buildcfg}"
-- interdir = "%{wks.location}/bin_int" interdir = "%{wks.location}/bin_int"
-- workspace "ModelCompile" workspace "ModelCompile"
-- architecture "x64" architecture "x64"
-- configurations configurations
-- { {
-- "Release", "Release",
-- "Debug" "Debug"
-- } }
project "ModelCompiler" project "ModelCompiler"
kind "ConsoleApp" 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_FindInstances // search for instanced meshes and remove them by references to one master
| aiProcess_CalcTangentSpace // calculate tangents and bitangents if possible | aiProcess_CalcTangentSpace // calculate tangents and bitangents if possible
| aiProcess_JoinIdenticalVertices // join identical vertices/ optimize indexing | aiProcess_JoinIdenticalVertices // join identical vertices/ optimize indexing
| aiProcess_RemoveRedundantMaterials // remove redundant materials
| aiProcess_FindInvalidData // detect invalid model data, such as invalid normal vectors | 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_FlipUVs // flip the V to match the Vulkans way of doing UVs
| aiProcess_ValidateDataStructure
); );
if (!scene || !scene->HasMeshes()) if (!scene || !scene->HasMeshes())

View File

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