-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dataflow] add rendergraph ssubcomponent
- Loading branch information
1 parent
1bca400
commit 177728c
Showing
12 changed files
with
1,272 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
set(ra_dataflowrendering_target DataflowRendering) | ||
list(APPEND CMAKE_MESSAGE_INDENT "[${ra_dataflowrendering_target}] ") | ||
|
||
project(${ra_dataflowrendering_target} LANGUAGES CXX VERSION ${Radium_VERSION}) | ||
|
||
include(filelist.cmake) | ||
|
||
# configure library | ||
add_library( | ||
${ra_dataflowrendering_target} SHARED | ||
${dataflow_rendering_sources} ${dataflow_rendering_headers} ${dataflow_rendering_inlines} | ||
) | ||
|
||
# This one should be extracted directly from parent project properties. | ||
target_compile_definitions(${ra_dataflowrendering_target} PRIVATE RA_DATAFLOW_EXPORTS) | ||
|
||
target_compile_options(${ra_dataflowrendering_target} PUBLIC ${RA_DEFAULT_COMPILE_OPTIONS}) | ||
|
||
add_dependencies(${ra_dataflowrendering_target} DataflowCore Engine) | ||
target_link_libraries(${ra_dataflowrendering_target} PUBLIC DataflowCore Engine) | ||
|
||
message(STATUS "Configuring library ${ra_dataflowrendering_target} with standard settings") | ||
configure_radium_target(${ra_dataflowrendering_target}) | ||
# configure the library only. The package is a sub-package and should be configured independently | ||
configure_radium_library( | ||
TARGET ${ra_dataflowrendering_target} COMPONENT TARGET_DIR "Dataflow/Rendering" | ||
FILES "${dataflow_rendering_headers};${dataflow_rendering_inlines}" | ||
) | ||
# Generate cmake package | ||
configure_radium_package( | ||
NAME ${ra_dataflowrendering_target} PACKAGE_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in | ||
PACKAGE_DIR "lib/cmake/Radium/${ra_dataflowrendering_target}" NAME_PREFIX "Radium" | ||
) | ||
|
||
set(RADIUM_COMPONENTS ${RADIUM_COMPONENTS} ${ra_dataflowrendering_target} PARENT_SCOPE) | ||
|
||
if(RADIUM_ENABLE_PCH) | ||
target_precompile_headers(${ra_dataflowrendering_target} PRIVATE pch.hpp) | ||
endif() | ||
|
||
list(REMOVE_AT CMAKE_MESSAGE_INDENT -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -------------- Configuration of the Radium DataflowCore targets and definitions ----------------------- | ||
# Setup Engine and check for dependencies | ||
|
||
if (DataflowRendering_FOUND AND NOT TARGET DataflowRendering) | ||
set(Configure_DataflowRendering ON) | ||
# verify dependencies | ||
if(NOT DataflowCore_FOUND) | ||
# if in source dir | ||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../Dataflow/Core/RadiumDataflowCoreConfig.cmake") | ||
set(DataflowCore_FOUND TRUE) | ||
include(${CMAKE_CURRENT_LIST_DIR}/../Dataflow/Core/RadiumDataflowCoreConfig.cmake) | ||
else() | ||
# if in install dir | ||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../DataflowCore/RadiumDataflowCoreConfig.cmake") | ||
set(DataflowCore_FOUND TRUE) | ||
include(${CMAKE_CURRENT_LIST_DIR}/../DataflowCore/RadiumDataflowCoreConfig.cmake) | ||
else() | ||
set(Radium_FOUND False) | ||
set(Radium_NOT_FOUND_MESSAGE "Radium::DataflowQtGui: dependency DataflowCore not found") | ||
set(Configure_DataflowRendering OFF) | ||
endif() | ||
endif() | ||
endif() | ||
if(NOT Engine_FOUND) | ||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../Engine/RadiumEngineConfig.cmake") | ||
set(Gui_FOUND TRUE) | ||
include(${CMAKE_CURRENT_LIST_DIR}/../Engine/RadiumEngineConfig.cmake) | ||
else() | ||
set(Radium_FOUND False) | ||
set(Radium_NOT_FOUND_MESSAGE "Radium::DataflowRendering: dependency Engine not found") | ||
set(Configure_DataflowRendering OFF) | ||
endif() | ||
endif() | ||
endif() | ||
|
||
if(Configure_DataflowRendering) | ||
include("${CMAKE_CURRENT_LIST_DIR}/../Dataflow/Rendering/DataflowRenderingTargets.cmake") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#pragma once | ||
#include <Dataflow/RaDataflow.hpp> | ||
|
||
#include <Dataflow/Core/Node.hpp> | ||
|
||
#include <Core/Utils/Color.hpp> | ||
#include <Engine/Data/Texture.hpp> | ||
#include <Engine/Data/ViewingParameters.hpp> | ||
#include <Engine/Rendering/RenderObject.hpp> | ||
#include <Engine/Scene/Light.hpp> | ||
|
||
namespace Ra::Engine::Data { | ||
class ShaderProgramManager; | ||
} | ||
|
||
namespace Ra { | ||
namespace Dataflow { | ||
namespace Rendering { | ||
namespace Nodes { | ||
|
||
/** | ||
* Defining some useful aliases for data type | ||
* | ||
*/ | ||
|
||
using RenderObjectType = std::shared_ptr<Ra::Engine::Rendering::RenderObject>; | ||
using LightType = const Ra::Engine::Scene::Light*; | ||
using CameraType = Ra::Engine::Data::ViewingParameters; | ||
using ColorType = Ra::Core::Utils::Color; | ||
using TextureType = Ra::Engine::Data::Texture; | ||
|
||
/** | ||
* Base class for Rendering nodes. | ||
* Rendering nodes are nodes with some interface needed to render the scene. | ||
*/ | ||
class RA_DATAFLOW_API RenderingNode : public Dataflow::Core::Node, | ||
public Ra::Core::Utils::IndexedObject | ||
{ | ||
public: | ||
using Dataflow::Core::Node::Node; | ||
|
||
/// The resize(uint32_t width, uint32_t height) function is called when the application gets | ||
/// resized. Its goal is to resize the potential internal textures if needed. | ||
/// @param width The new width of the surface. | ||
/// @param height The new height of the surface. | ||
virtual void resize( uint32_t width, uint32_t height ) = 0; | ||
|
||
/// Build a render technic per material. | ||
/// @param ro The render object to get the material from | ||
/// @param rt The render technic to build | ||
virtual void buildRenderTechnique( const Ra::Engine::Rendering::RenderObject*, | ||
Ra::Engine::Rendering::RenderTechnique& ) const {}; | ||
|
||
/// Indicate if the nod needs to setup a rendertechnique on RenderObjects | ||
virtual bool hasRenderTechnique() { return false; } | ||
|
||
/// Sets the shader program manager | ||
void setShaderProgramManager( Ra::Engine::Data::ShaderProgramManager* shaderMngr ) { | ||
m_shaderMngr = shaderMngr; | ||
} | ||
|
||
static const std::string getTypename() { return "RenderingNode"; } | ||
|
||
protected: | ||
void toJsonInternal( nlohmann::json& ) const override {} | ||
void fromJsonInternal( const nlohmann::json& ) override {} | ||
|
||
/// The renderer's shader program manager | ||
Ra::Engine::Data::ShaderProgramManager* m_shaderMngr; | ||
}; | ||
|
||
} // namespace Nodes | ||
} // namespace Rendering | ||
} // namespace Dataflow | ||
} // namespace Ra |
Oops, something went wrong.