Skip to content

Commit

Permalink
PLYLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-van-bergen committed Aug 16, 2021
1 parent ebb3bd3 commit 6dff630
Show file tree
Hide file tree
Showing 7 changed files with 410 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Pathtracer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
<ClCompile Include="Src\Assets\MeshData.cpp" />
<ClCompile Include="Src\Assets\MitsubaLoader.cpp" />
<ClCompile Include="Src\Assets\OBJLoader.cpp" />
<ClCompile Include="Src\Assets\PLYLoader.cpp" />
<ClCompile Include="Src\Assets\Texture.cpp" />
<ClCompile Include="Src\Assets\TextureLoader.cpp" />
<ClCompile Include="Src\BVH\Builders\CWBVHBuilder.cpp" />
Expand Down Expand Up @@ -247,6 +248,7 @@
<ClInclude Include="Src\Assets\MeshData.h" />
<ClInclude Include="Src\Assets\MitsubaLoader.h" />
<ClInclude Include="Src\Assets\OBJLoader.h" />
<ClInclude Include="Src\Assets\PLYLoader.h" />
<ClInclude Include="Src\Assets\Texture.h" />
<ClInclude Include="Src\Assets\TextureLoader.h" />
<ClInclude Include="Src\BVH\Builders\BVHBuilder.h" />
Expand Down
6 changes: 6 additions & 0 deletions Pathtracer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@
<ClCompile Include="Src\Math\Mipmap.cpp">
<Filter>Math</Filter>
</ClCompile>
<ClCompile Include="Src\Assets\PLYLoader.cpp">
<Filter>Assets</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="CUDA">
Expand Down Expand Up @@ -313,5 +316,8 @@
<ClInclude Include="Src\Util\Parser.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Assets\PLYLoader.h">
<Filter>Assets</Filter>
</ClInclude>
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion Src/Assets/AssetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ void AssetManager::init() {
thread_pool.init();
}

#include "PLYLoader.h"

MeshDataHandle AssetManager::add_mesh_data(const char * filename) {
MeshDataHandle & mesh_data_handle = mesh_data_cache[filename];

Expand All @@ -56,7 +58,7 @@ MeshDataHandle AssetManager::add_mesh_data(const char * filename) {
bool bvh_loaded = BVHLoader::try_to_load(filename, mesh_data, bvh);
if (!bvh_loaded) {
// Unable to load disk cached BVH, load model from source and construct BVH
OBJLoader::load(filename, mesh_data.triangles, mesh_data.triangle_count);
PLYLoader::load(filename, mesh_data.triangles, mesh_data.triangle_count);

bvh = build_bvh(mesh_data.triangles, mesh_data.triangle_count);
BVHLoader::save(filename, mesh_data, bvh);
Expand Down
Loading

0 comments on commit 6dff630

Please sign in to comment.