Skip to content

Commit

Permalink
3d: implement a fulldome projection mode suitable for point clouds an…
Browse files Browse the repository at this point in the history
…d detailed geometry

Based on @paperManu's approach detailed here:

https://emmanueldurand.net/spherical_projection/
  • Loading branch information
jcelerier committed Jan 19, 2025
1 parent 518839c commit 542e681
Show file tree
Hide file tree
Showing 8 changed files with 263 additions and 250 deletions.
2 changes: 0 additions & 2 deletions src/plugins/score-plugin-gfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ set(HDRS
Gfx/ShaderProgram.hpp
Gfx/SharedInputSettings.hpp
Gfx/SharedOutputSettings.hpp
Gfx/Qt5CompatPush
Gfx/Qt5CompatPop

Gfx/CameraSettings.hpp
Gfx/CameraDevice.hpp
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/score-plugin-gfx/Gfx/Graph/CommonUBOs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ struct ModelCameraUBO
float projection[16]{};
float modelNormal[9]{};
float padding[3]; // Needed as a mat3 needs a bit more space...
float fov = 90.;
};

static_assert(
sizeof(ModelCameraUBO) == sizeof(float) * (16 + 16 + 16 + 16 + 16 + 9 + 3));
static_assert(
sizeof(ModelCameraUBO) == sizeof(float) * (16 + 16 + 16 + 16 + 16 + 9 + 3 + 1));

/**
* @brief UBO shared across all entities shown on the same output.
Expand Down
94 changes: 33 additions & 61 deletions src/plugins/score-plugin-threedim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,31 @@ endif()
find_package(${QT_VERSION} REQUIRED COMPONENTS Xml)

# libssynth
add_library(ssynth STATIC
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Parser/EisenParser.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Parser/Preprocessor.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Parser/Tokenizer.cpp"

"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Action.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/AmbiguousRule.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Builder.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/CustomRule.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/PrimitiveRule.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/RuleSet.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/State.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Transformation.cpp"

"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Rendering/TemplateRenderer.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Rendering/ObjRenderer.cpp"

"${3RDPARTY_FOLDER}/libssynth/src/ssynth/ColorPool.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/ColorUtils.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Logging.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/MiniParser.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/RandomStreams.cpp"
)
target_include_directories(ssynth
SYSTEM PRIVATE
"${3RDPARTY_FOLDER}/libssynth/src"
)

target_link_libraries(ssynth
PRIVATE
"${QT_PREFIX}::Core"
"${QT_PREFIX}::Gui"
"${QT_PREFIX}::Xml"
score_lib_base
)
add_library(
ssynth STATIC
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Parser/EisenParser.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Parser/Preprocessor.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Parser/Tokenizer.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Action.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/AmbiguousRule.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Builder.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/CustomRule.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/PrimitiveRule.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/RuleSet.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/State.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Transformation.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Rendering/TemplateRenderer.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Model/Rendering/ObjRenderer.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/ColorPool.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/ColorUtils.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/Logging.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/MiniParser.cpp"
"${3RDPARTY_FOLDER}/libssynth/src/ssynth/RandomStreams.cpp")
target_include_directories(ssynth SYSTEM
PRIVATE "${3RDPARTY_FOLDER}/libssynth/src")

target_link_libraries(ssynth PRIVATE "${QT_PREFIX}::Core" "${QT_PREFIX}::Gui"
"${QT_PREFIX}::Xml" score_lib_base)

if(NOT MSVC)
target_compile_options(ssynth PRIVATE -w)
Expand All @@ -60,56 +50,38 @@ add_library(
score_plugin_threedim
Threedim/ModelDisplay/ModelDisplayNode.hpp
Threedim/ModelDisplay/ModelDisplayNode.cpp

Threedim/TinyObj.hpp
Threedim/TinyObj.cpp
Threedim/Ply.hpp
Threedim/Ply.cpp

Threedim/ArrayToGeometry.hpp
Threedim/ArrayToGeometry.cpp

Threedim/StructureSynth.hpp
Threedim/StructureSynth.cpp

Threedim/ObjLoader.hpp
Threedim/ObjLoader.cpp

Threedim/Primitive.hpp
Threedim/Primitive.cpp

Threedim/Noise.hpp
Threedim/Noise.cpp

Threedim/ModelDisplay/Executor.hpp
Threedim/ModelDisplay/Executor.cpp
Threedim/ModelDisplay/Metadata.hpp
Threedim/ModelDisplay/Process.hpp
Threedim/ModelDisplay/Process.cpp
Threedim/ModelDisplay/Layer.hpp

"${3RDPARTY_FOLDER}/miniply/miniply.cpp"

score_plugin_threedim.hpp
score_plugin_threedim.cpp
)
score_plugin_threedim.cpp)

set_property(TARGET score_plugin_threedim PROPERTY SCORE_CUSTOM_PCH 1)
setup_score_plugin(score_plugin_threedim)

target_include_directories(score_plugin_threedim
SYSTEM PRIVATE
"${3RDPARTY_FOLDER}/libssynth/src"
"${3RDPARTY_FOLDER}/vcglib"
"${3RDPARTY_FOLDER}/eigen"
"${3RDPARTY_FOLDER}/miniply"
)
target_include_directories(
score_plugin_threedim SYSTEM
PRIVATE "${3RDPARTY_FOLDER}/libssynth/src" "${3RDPARTY_FOLDER}/vcglib"
"${3RDPARTY_FOLDER}/eigen" "${3RDPARTY_FOLDER}/miniply")

target_link_libraries(score_plugin_threedim
PRIVATE
score_plugin_engine
score_plugin_avnd
score_plugin_gfx
fmt::fmt
ssynth
)
target_link_libraries(
score_plugin_threedim PRIVATE score_plugin_engine score_plugin_avnd
score_plugin_gfx fmt::fmt ssynth)
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ProcessExecutorComponent::ProcessExecutorComponent(
n->root_inputs().push_back(new ossia::texture_inlet);
n->root_inputs().push_back(new ossia::geometry_inlet);

for (std::size_t i = 2; i <= 8; i++)
for(std::size_t i = 2; i <= 9; i++)
{
auto ctrl = qobject_cast<Process::ControlInlet*>(element.inlets()[i]);
auto& p = n->add_control();
Expand Down
Loading

0 comments on commit 542e681

Please sign in to comment.