Skip to content

Commit 10d29dd

Browse files
committed
Merge branch 'develop'
2 parents 2c346d9 + ecea8ca commit 10d29dd

38 files changed

+395
-129
lines changed

CMakeLists.txt

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ message("Render Pipeline building version: ${render_pipeline_VERSION}")
3232
# configure project package
3333
include(FindPackages)
3434

35-
set(render_pipeline_SETTING_CMAKE_FILE "${PROJECT_SOURCE_DIR}/cmake/render_pipeline-setting.cmake")
36-
include(${render_pipeline_SETTING_CMAKE_FILE})
37-
38-
# subdirectory
39-
add_subdirectory("${PROJECT_SOURCE_DIR}/src/rpplugins")
35+
set(render_pipeline_MACRO_CMAKE_FILE "${PROJECT_SOURCE_DIR}/cmake/render_pipeline-macro.cmake")
36+
include(${render_pipeline_MACRO_CMAKE_FILE})
4037

4138
# === project specific packages ===
4239
# find spdlog
@@ -97,9 +94,7 @@ set(PACKAGE_VERSION "${PROJECT_VERSION}")
9794
set(PACKAGE_VERSION_CONFIG_FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake")
9895
set(PACKAGE_CONFIG_FILE "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake")
9996
set(TARGET_EXPORT_NAME "${PACKAGE_NAME}-targets")
100-
set(PACKAGE_CMAKE_INSTALL_DIR "lib/${PROJECT_NAME}/cmake")
101-
file(RELATIVE_PATH PACKAGE_CMAKE_INSTALL_DIR2ROOT_DIR "${CMAKE_INSTALL_PREFIX}/${PACKAGE_CMAKE_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}")
102-
get_filename_component(PACKAGE_CMAKE_INSTALL_DIR2ROOT_DIR "${PACKAGE_CMAKE_INSTALL_DIR2ROOT_DIR}/." DIRECTORY)
97+
set(PACKAGE_CMAKE_INSTALL_DIR "lib/cmake/${PACKAGE_NAME}")
10398

10499
include(CMakePackageConfigHelpers)
105100
write_basic_package_version_file(${PACKAGE_VERSION_CONFIG_FILE}
@@ -111,33 +106,31 @@ configure_package_config_file("${PROJECT_SOURCE_DIR}/cmake/${PACKAGE_NAME}-confi
111106
${PACKAGE_CONFIG_FILE}
112107
INSTALL_DESTINATION ${PACKAGE_CMAKE_INSTALL_DIR}
113108
)
114-
115-
export(TARGETS ${PROJECT_NAME} FILE ${PROJECT_BINARY_DIR}/${TARGET_EXPORT_NAME}.cmake)
116-
export(PACKAGE ${PACKAGE_NAME})
117109
# ==================================================================================================
118110

119111
# === install ======================================================================================
120-
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME ${PROJECT_NAME})
112+
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME ${PACKAGE_NAME})
121113

122114
install(TARGETS ${PROJECT_NAME}
123115
EXPORT ${TARGET_EXPORT_NAME}
124116
RUNTIME DESTINATION "bin"
125117
LIBRARY DESTINATION "lib"
126118
ARCHIVE DESTINATION "lib"
127119
)
120+
export(EXPORT ${TARGET_EXPORT_NAME} FILE ${PROJECT_BINARY_DIR}/${TARGET_EXPORT_NAME}.cmake)
128121

129122
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.pdb"
130123
DESTINATION "bin"
131124
CONFIGURATIONS Debug RelWithDebInfo
132125
)
133126

134127
install(DIRECTORY "${PROJECT_SOURCE_DIR}/${PROJECT_NAME}" DESTINATION "include/")
135-
install(DIRECTORY "${PROJECT_SOURCE_DIR}/resources/config/" DESTINATION "${render_pipeline_CONFIG_DIR}/")
128+
install(DIRECTORY "${PROJECT_SOURCE_DIR}/resources/config" DESTINATION "${render_pipeline_DATA_DIR}/")
136129
install(DIRECTORY "${PROJECT_SOURCE_DIR}/resources/data" DESTINATION "${render_pipeline_DATA_DIR}/")
137130
install(DIRECTORY "${PROJECT_SOURCE_DIR}/resources/effects" DESTINATION "${render_pipeline_DATA_DIR}/")
138131
install(DIRECTORY "${PROJECT_SOURCE_DIR}/resources/rpcore" DESTINATION "${render_pipeline_DATA_DIR}/")
139132

140-
install(FILES ${PACKAGE_CONFIG_FILE} ${PACKAGE_VERSION_CONFIG_FILE} ${render_pipeline_SETTING_CMAKE_FILE}
133+
install(FILES ${PACKAGE_CONFIG_FILE} ${PACKAGE_VERSION_CONFIG_FILE} ${render_pipeline_MACRO_CMAKE_FILE}
141134
DESTINATION ${PACKAGE_CMAKE_INSTALL_DIR}
142135
)
143136
install(EXPORT ${TARGET_EXPORT_NAME} DESTINATION ${PACKAGE_CMAKE_INSTALL_DIR})
@@ -162,3 +155,7 @@ install(FILES
162155
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md"
163156
DESTINATION "share/${PROJECT_NAME}/")
164157
# ==================================================================================================
158+
159+
# === subdirectory =================================================================================
160+
add_subdirectory("${PROJECT_SOURCE_DIR}/src/rpplugins")
161+
# ==================================================================================================

cmake/FindPackages.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ _find_boost("filesystem")
3030

3131
if(NOT TARGET panda3d::panda3d)
3232
# find panda3d
33-
set(PANDA3D_ROOT "" CACHE PATH "Hint for finding panda3d root directory")
33+
set(panda3d_ROOT "" CACHE PATH "Hint for finding panda3d root directory")
3434
find_package(panda3d REQUIRED)
3535
endif()
3636

cmake/plugin_install.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
install(TARGETS ${PROJECT_NAME} DESTINATION ${RPPLUGIN_INSTALL_DIR})
22
install(TARGETS ${RPPLUGIN_ID} EXPORT ${TARGET_EXPORT_NAME})
3+
export(EXPORT ${TARGET_EXPORT_NAME}
4+
NAMESPACE ${TARGET_NAMESPACE}
5+
FILE "${PROJECT_BINARY_DIR}/${TARGET_EXPORT_NAME}.cmake"
6+
)
37

48
install(FILES "${PROJECT_SOURCE_DIR}/config.yaml" DESTINATION ${RPPLUGIN_INSTALL_DIR})
59
foreach(directory_name "include" "resources" "shader")

cmake/render_pipeline-config.cmake.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
@PACKAGE_INIT@
22

3-
set (@PACKAGE_NAME@_VERSION "@PACKAGE_VERSION@")
3+
include(CMakeFindDependencyMacro)
4+
find_dependency(panda3d)
5+
find_dependency(Boost 1.62.0)
46

57
include(${CMAKE_CURRENT_LIST_DIR}/@TARGET_EXPORT_NAME@.cmake)
6-
include(${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_NAME@-setting.cmake)
8+
include(${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_NAME@-macro.cmake)
79

8-
set(@PACKAGE_NAME@_INSTALL_DIR "${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_CMAKE_INSTALL_DIR2ROOT_DIR@")
10+
set(@PACKAGE_NAME@_VERSION "@PACKAGE_VERSION@")
11+
set(@PACKAGE_NAME@_INSTALL_DIR ${PACKAGE_PREFIX_DIR})
912

1013
message(STATUS "@PACKAGE_NAME@ version: ${@PACKAGE_NAME@_VERSION}")
1114

cmake/render_pipeline-setting.cmake renamed to cmake/render_pipeline-macro.cmake

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
set(render_pipeline_CONFIG_DIR "etc/render_pipeline")
2-
set(render_pipeline_DATA_DIR "share/render_pipeline")
3-
set(render_pipeline_PLUGIN_DIR "${render_pipeline_DATA_DIR}/rpplugins")
1+
# render pipeline variable
2+
set(render_pipeline_DATA_DIR "share/render_pipeline" CACHE INTERNAL
3+
"Relative path of data directory in Render Pipeline"
4+
)
5+
set(render_pipeline_PLUGIN_DIR "${render_pipeline_DATA_DIR}/rpplugins" CACHE INTERNAL
6+
"Relative path of plugin directory in Render Pipeline"
7+
)
48

5-
# help function to find plugin
9+
# help function to find rpplugin
610
function(render_pipeline_FIND_PLUGINS plugin_id_list)
711
set(missed_plugin_id_list "")
812
foreach(plugin_id ${plugin_id_list})
@@ -14,8 +18,6 @@ function(render_pipeline_FIND_PLUGINS plugin_id_list)
1418
if(missed_plugin_id_list)
1519
if(render_pipeline_INSTALL_DIR)
1620
set(PLUGIN_DIR_HINT "${render_pipeline_INSTALL_DIR}/${render_pipeline_PLUGIN_DIR}")
17-
else()
18-
message(WARNING "render_pipeline_INSTALL_DIR is NOT set.")
1921
endif()
2022

2123
foreach(plugin_id ${missed_plugin_id_list})

files.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ set(header_rpcore_stages
114114
)
115115

116116
set(header_rpcore_util
117+
"${PROJECT_SOURCE_DIR}/render_pipeline/rpcore/util/circular_points_node.hpp"
117118
"${PROJECT_SOURCE_DIR}/render_pipeline/rpcore/util/cubemap_filter.h"
118119
"${PROJECT_SOURCE_DIR}/render_pipeline/rpcore/util/generic.h"
119120
"${PROJECT_SOURCE_DIR}/render_pipeline/rpcore/util/instancing_node.hpp"
@@ -288,6 +289,7 @@ set(source_rpcore_stages
288289
)
289290

290291
set(source_rpcore_util
292+
"${PROJECT_SOURCE_DIR}/src/rpcore/util/circular_points_node.cpp"
291293
"${PROJECT_SOURCE_DIR}/src/rpcore/util/cubemap_filter.cpp"
292294
"${PROJECT_SOURCE_DIR}/src/rpcore/util/display_shader_builder.cpp"
293295
"${PROJECT_SOURCE_DIR}/src/rpcore/util/display_shader_builder.h"

render_pipeline/rpcore/render_pipeline.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ class RENDER_PIPELINE_DECL RenderPipeline: public RPObject
3838
template <class Type> Type get_setting(const std::string& setting_path, const Type& fallback) const;
3939

4040
public:
41-
static RenderPipeline* get_global_ptr(void);
41+
static RenderPipeline* get_global_ptr(void);
4242

43-
RenderPipeline(void);
44-
~RenderPipeline(void);
43+
RenderPipeline(void);
44+
~RenderPipeline(void);
4545

46-
/**
47-
* Loads the pipeline configuration from a given filename. Usually
48-
* this is the 'config/pipeline.ini' file. If you call this more than once,
49-
* only the settings of the last file will be used.
50-
*/
51-
void load_settings(const std::string& path);
46+
/**
47+
* Loads the pipeline configuration from a given filename. Usually
48+
* this is the 'config/pipeline.ini' file. If you call this more than once,
49+
* only the settings of the last file will be used.
50+
*/
51+
void load_settings(const std::string& path);
5252

5353
/**
5454
* Reloads all shaders. This will reload the shaders of all plugins,
@@ -95,7 +95,7 @@ class RENDER_PIPELINE_DECL RenderPipeline: public RPObject
9595

9696
/** See internal_set_effect. */
9797
void set_effect(NodePath& nodepath, const std::string& effect_src,
98-
const Effect::OptionType& options=Effect::OptionType(), int sort=30);
98+
const Effect::OptionType& options={}, int sort=30);
9999

100100
/**
101101
* Prepares a given scene, by converting panda lights to render pipeline
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#pragma once
2+
3+
#include <nodePath.h>
4+
5+
#include <render_pipeline/rpcore/config.h>
6+
7+
namespace rpcore {
8+
9+
class RENDER_PIPELINE_DECL CircularPointsNode
10+
{
11+
public:
12+
CircularPointsNode(const std::string& name, const std::vector<LPoint3f>& positions, float radius=1.0f,
13+
const std::string& effect_path="", GeomEnums::UsageHint buffer_hint=GeomEnums::UH_static);
14+
15+
~CircularPointsNode(void);
16+
17+
NodePath get_nodepath(void) const;
18+
19+
/** Get the count of instances. */
20+
int get_point_count(void) const;
21+
22+
/** Get position. */
23+
const LPoint3f& get_position(int point_index) const;
24+
25+
/** Get local instancing tranforms. */
26+
const std::vector<LPoint3f>& get_positions(void) const;
27+
28+
LPoint3f* modify_positions(void);
29+
30+
/** Set local instancing transform. */
31+
void set_position(const LPoint3f& positions, int point_index);
32+
33+
/** Set local instancing transforms and change instance count to the size of @p transforms. */
34+
void set_positions(const std::vector<LPoint3f>& positions);
35+
36+
/** Upload transform buffer texture to GPU. */
37+
void upload_positions(void);
38+
39+
void set_radius(float radius);
40+
41+
/**
42+
* Set a count of active points.
43+
*
44+
* Panda3D will draw points as given counts.
45+
* If @a count is -1, all points will be used.
46+
*/
47+
void set_active_point_count(int count);
48+
49+
private:
50+
struct Impl;
51+
std::shared_ptr<Impl> impl_;
52+
};
53+
54+
}
55+

render_pipeline/rpcore/util/primitives.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace rpcore {
88

9+
RENDER_PIPELINE_DECL NodePath create_points(const std::string& name, const std::vector<LPoint3f>& positions,
10+
GeomEnums::UsageHint buffer_hint=Geom::UsageHint::UH_static);
11+
912
RENDER_PIPELINE_DECL NodePath create_cube(const std::string& name);
1013
RENDER_PIPELINE_DECL NodePath create_sphere(const std::string& name, unsigned int latitude, unsigned int longitude);
1114

resources/config/plugins.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ enabled:
2323
# - volumetrics
2424
# - vxgi
2525

26+
# stereo plugins
27+
#enabled:
28+
# - bloom
29+
# - color_correction
30+
# - forward_shading
31+
# - pssm
32+
# - scattering
33+
# - sky_ao
34+
# - openvr
35+
# - env_probes
36+
2637

2738
overrides:
2839
ao:

0 commit comments

Comments
 (0)