2 #include <Gfx/Graph/CommonUBOs.hpp>
3 #include <Gfx/Graph/Mesh.hpp>
4 #include <Gfx/Graph/RenderState.hpp>
5 #include <Gfx/Graph/Uniforms.hpp>
6 #include <Gfx/Graph/Utils.hpp>
8 #include <ossia/dataflow/geometry_port.hpp>
9 #include <ossia/dataflow/nodes/media.hpp>
10 #include <ossia/dataflow/token_request.hpp>
11 #include <ossia/detail/flat_map.hpp>
12 #include <ossia/detail/variant.hpp>
13 #include <ossia/network/value/value.hpp>
15 #include <score_plugin_gfx_export.h>
25 class GenericNodeRenderer;
28 #if BOOST_VERSION < 107900
30 using gfx_input = ossia::slow_variant<
31 ossia::monostate, ossia::value, ossia::audio_vector, ossia::geometry_spec,
32 ossia::transform3d, FunctionMessage>;
34 using gfx_input = ossia::variant<
35 ossia::monostate, ossia::value, ossia::audio_vector, ossia::geometry_spec,
36 ossia::transform3d, FunctionMessage>;
46 ossia::time_value date{};
47 ossia::time_value parent_duration{};
54 std::vector<gfx_input> input;
59 class SCORE_PLUGIN_GFX_EXPORT
Node
67 Node& operator=(
const Node&) =
delete;
78 virtual void renderedNodesChanged();
83 virtual void process(
Message&& msg);
84 virtual void update();
95 ossia::small_pod_vector<Port*, 1>
output;
119 materialChanged.fetch_add(1, std::memory_order_release);
121 bool hasMaterialChanged(int64_t& renderer)
const noexcept
123 int64_t res = materialChanged.load(std::memory_order_acquire);
131 std::atomic_int64_t materialChanged{0};
138 geometryChanged.fetch_add(1, std::memory_order_release);
140 bool hasGeometryChanged(int64_t& renderer)
const noexcept
142 int64_t res = geometryChanged.load(std::memory_order_acquire);
150 std::atomic_int64_t geometryChanged{-1};
167 void process(
Message&& msg)
override;
169 void process(int32_t port,
const ossia::value& v);
170 void process(int32_t port,
const ossia::audio_vector& v);
171 void process(int32_t port,
const ossia::geometry_spec& v);
172 void process(int32_t port,
const ossia::transform3d& v);
173 void process(int32_t port, ossia::monostate)
const noexcept { }
174 void process(int32_t port,
const FunctionMessage&);
187 createRenderer(
RenderList& r)
const noexcept
override;
190 std::unique_ptr<char[]> m_materialData;
197 QDebug operator<<(QDebug,
const std::vector<score::gfx::gfx_input>&);
Generic renderer.
Definition: NodeRenderer.hpp:61
Root data model for visual nodes.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:60
std::vector< Port * > input
Input ports of that node.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:89
virtual NodeRenderer * createRenderer(RenderList &r) const noexcept=0
Create a renderer in a given context for this node.
ossia::flat_map< RenderList *, score::gfx::NodeRenderer * > renderedNodes
Map associating each RenderList to a Renderer for this model.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:100
ossia::small_pod_vector< Port *, 1 > output
Output ports of that node.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:95
Common base class for most single-pass, simple nodes.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:181
Renderer for a given node.
Definition: NodeRenderer.hpp:11
Common base class for nodes that map to score processes.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:110
ossia::geometry_spec geometry
The geometry to use.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:165
void geometryChange() noexcept
Used to notify a geometry change from the model to the renderers.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:136
void materialChange() noexcept
Used to notify a material change from the model to the renderers.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:117
List of nodes to be rendered to an output.
Definition: RenderList.hpp:19
Graphics rendering pipeline for ossia score.
Definition: Filter/PreviewWidget.hpp:12
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:51
UBO specific to individual processes / nodes.
Definition: CommonUBOs.hpp:12
Messages sent from the execution thread to the rendering thread.
Definition: score-plugin-gfx/Gfx/Graph/Node.hpp:45