Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,9 @@ if(UNIX)
"$ORIGIN/lib"
"${CUDAToolkit_LIBRARY_DIR}"
)
if(TARGET OpenMeshCore)
list(APPEND _lichtfeld_runtime_rpath_common "$<TARGET_FILE_DIR:OpenMeshCore>")
endif()
set(_lichtfeld_runtime_rpath_release "${_lichtfeld_runtime_rpath_common}")
set(_lichtfeld_runtime_rpath_debug "${_lichtfeld_runtime_rpath_common}")
if(DEFINED VCPKG_TARGET_TRIPLET)
Expand Down
33 changes: 0 additions & 33 deletions external/zep/src/indexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,6 @@

namespace Zep {

enum TypeName {
t_class,
t_void,
t_byte,
t_char,
t_int,
t_long,
t_float,
t_double,
t_uint32_t,
t_uint8_t,
t_uint64_t,
t_int32_t,
t_int64_t,
t_int8_t
};

std::map<std::string, TypeName> MapToType = {
{"class", t_class},
{"void", t_void},
{"byte", t_byte},
{"char", t_char},
{"int", t_int},
{"long", t_long},
{"float", t_float},
{"double", t_double},
{"uint32_t", t_uint32_t},
{"uint8_t", t_uint8_t},
{"uint64_t", t_uint64_t},
{"int32_t", t_int32_t},
{"int64_t", t_int64_t},
{"int8_t", t_int8_t}};

Indexer::Indexer(ZepEditor& editor)
: ZepComponent(editor) {
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ target_link_libraries(lfs_core
lfs_tensor_kernels
taywee::args
OpenImageIO::OpenImageIO
$<IF:$<PLATFORM_ID:Windows>,OpenMeshCore,OpenMeshCoreStatic>
OpenMeshCore
)

# OpenMP for tensor multi-threaded operations
Expand Down
6 changes: 3 additions & 3 deletions src/core/argument_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ namespace {
::args::Group mode_group(parser, "MODE SELECTION:");
::args::HelpFlag help(mode_group, "help", "Display help menu", {'h', "help"});
::args::Flag version(mode_group, "version", "Display version information", {'V', "version"});
::args::ValueFlag<std::string> view_ply(mode_group, "path", "View file(s). Supports splat (.ply, .sog, .spz, .usd, .usda, .usdc, .usdz) and mesh (.obj, .fbx, .gltf, .glb, .stl) formats. If directory, loads all.", {'v', "view"});
::args::ValueFlag<std::string> view_ply(mode_group, "path", "View file(s). Supports splat (.ply, .sog, .spz, .rad, .usd, .usda, .usdc, .usdz) and mesh (.obj, .fbx, .gltf, .glb, .stl) formats. If directory, loads all.", {'v', "view"});
::args::ValueFlag<std::string> resume_checkpoint(mode_group, "checkpoint", "Resume training from checkpoint file", {"resume"});
::args::CompletionFlag completion(parser, {"complete"});

Expand Down Expand Up @@ -425,8 +425,8 @@ namespace {
return std::unexpected(std::format("Path does not exist: {}", lfs::core::path_to_utf8(view_path)));
}

constexpr std::array<std::string_view, 12> SUPPORTED_EXTENSIONS = {
".ply", ".sog", ".spz", ".resume",
constexpr std::array<std::string_view, 13> SUPPORTED_EXTENSIONS = {
".ply", ".sog", ".spz", ".rad", ".resume",
".obj", ".fbx", ".gltf", ".glb", ".stl", ".dae", ".3ds", ".blend"};
const auto is_supported = [&](const std::filesystem::path& p) {
auto ext = p.extension().string();
Expand Down
2 changes: 2 additions & 0 deletions src/core/include/core/export.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#ifdef _WIN32
#define LFS_LOCAL_SYMBOL
#ifdef LFS_LOGGER_EXPORTS
#define LFS_LOGGER_API __declspec(dllexport)
#else
Expand All @@ -26,6 +27,7 @@
#define LFS_MCP_API __declspec(dllimport)
#endif
#else
#define LFS_LOCAL_SYMBOL __attribute__((visibility("hidden")))
#define LFS_LOGGER_API __attribute__((visibility("default")))
#define LFS_CORE_API __attribute__((visibility("default")))
#define LFS_IO_API __attribute__((visibility("default")))
Expand Down
17 changes: 16 additions & 1 deletion src/core/include/core/splat_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <expected>
#include <filesystem>
#include <functional>
#include <glm/fwd.hpp>
#include <glm/glm.hpp>
#include <string>
#include <string_view>
#include <vector>
Expand All @@ -28,6 +28,18 @@ namespace lfs::core {
struct TrainingParameters;
}

struct SplatLodTree {
std::vector<uint16_t> child_count;
std::vector<uint32_t> child_start;
std::vector<uint8_t> lod_level;
std::vector<glm::vec3> centers;
std::vector<float> sizes;
bool lod_opacity_encoded = false;

size_t total_nodes() const { return child_count.size(); }
bool has_tree() const { return !child_count.empty(); }
};

using SplatTensorAllocator = std::function<Tensor(TensorShape shape,
size_t capacity,
DataType dtype,
Expand Down Expand Up @@ -201,6 +213,9 @@ namespace lfs::core {
// Holds the magnitude of the screen space gradient (used for densification)
Tensor _densification_info;

// Optional LOD tree (populated by RAD loader, null for training/non-RAD scenes)
std::unique_ptr<SplatLodTree> lod_tree;

private:
int _active_sh_degree = 0;
int _max_sh_degree = 0;
Expand Down
5 changes: 2 additions & 3 deletions src/core/include/core/splat_simplify_history.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ namespace lfs::core {

int target_count = 0;
int post_prune_count = 0;
double requested_ratio = 0.1;
int requested_knn_k = 16;
double requested_merge_cap = 0.5;
double requested_ratio = 0.5;
float requested_lod_base = 2.0f;
float requested_opacity_prune_threshold = 0.1f;

std::vector<int32_t> final_roots;
Expand Down
5 changes: 2 additions & 3 deletions src/core/include/core/splat_simplify_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
namespace lfs::core {

struct SplatSimplifyOptions {
double ratio = 0.1;
int knn_k = 16;
double merge_cap = 0.5;
double ratio = 0.5;
float lod_base = 2.0f;
float opacity_prune_threshold = 0.1f;
};

Expand Down
4 changes: 4 additions & 0 deletions src/core/splat_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ namespace lfs::core {
_deleted(std::move(other._deleted)),
_deleted_count(other._deleted_count.load(std::memory_order_relaxed)),
_tensor_allocator(std::move(other._tensor_allocator)),
lod_tree(std::move(other.lod_tree)),
_frozen_ranges(std::move(other._frozen_ranges)) {
// Reset the moved-from object
other._active_sh_degree = 0;
Expand All @@ -576,6 +577,9 @@ namespace lfs::core {
_opacity = std::move(other._opacity);
_densification_info = std::move(other._densification_info);
_deleted = std::move(other._deleted);

// Move LOD tree
lod_tree = std::move(other.lod_tree);
_deleted_count.store(other._deleted_count.load(std::memory_order_relaxed),
std::memory_order_relaxed);
_tensor_allocator = std::move(other._tensor_allocator);
Expand Down
Loading
Loading