Loading...
Searching...
No Matches
GeometryToBuffer.hpp
1#pragma once
2#include <Threedim/GeometryToBufferStrategies.hpp>
3#include <halp/buffer.hpp>
4
5namespace Threedim
6{
8{
9public:
10 halp_meta(name, "Extract buffer")
11 halp_meta(category, "Visuals/3D")
12 halp_meta(c_name, "extract_attribute")
13 halp_meta(manual_url, "https://ossia.io/score-docs/processes/extract-buffer.html")
14 halp_meta(uuid, "207ab744-1f3e-4e72-9a77-db6017cf3dd5")
15
16 enum Attribute
17 {
18 Position,
19 TexCoord,
20 Color,
21 Normal,
22 Tangent,
23
24 Attribute_0,
25 Attribute_1,
26 Attribute_2,
27 Attribute_3,
28 Attribute_4,
29 Attribute_5,
30 Attribute_6,
31 Attribute_7,
32 Attribute_8,
33
34 Index,
35
36 Buffer_0,
37 Buffer_1,
38 Buffer_2,
39 Buffer_3,
40 Buffer_4,
41 Buffer_5,
42 Buffer_6,
43 Buffer_7,
44 Buffer_8
45 };
46
47 struct ins
48 {
49 struct
50 {
51 halp_meta(name, "Geometry");
52 halp::dynamic_gpu_geometry mesh;
53 float transform[16]{};
54 bool dirty_mesh = false;
55 bool dirty_transform = false;
56 } geometry;
57
58 halp::combobox_t<"Attribute", Attribute> attribute;
59 halp::toggle<"Pad vec3 to vec4"> pad_to_vec4;
60 } inputs;
61
62 struct
63 {
64 halp::gpu_buffer_output<"Buffer"> buffer;
65 } outputs;
66
68
69 void init(score::gfx::RenderList& renderer, QRhiResourceUpdateBatch& res);
70
71 void update(
72 score::gfx::RenderList& renderer, QRhiResourceUpdateBatch& res,
74
75 void release(score::gfx::RenderList& r);
76
77 void runInitialPasses(
78 score::gfx::RenderList& renderer, QRhiCommandBuffer& commands,
79 QRhiResourceUpdateBatch*& res, score::gfx::Edge& edge);
80
81 void operator()();
82
83private:
84 [[nodiscard]] static halp::attribute_location
85 toAttributeLocation(Attribute attr) noexcept;
86 void updateOutput();
87
88 ExtractionStrategyVariant m_strategy;
89 Attribute m_currentAttribute{Position};
90 bool m_currentPadToVec4{false};
91};
92}
Definition GeometryToBuffer.hpp:8
List of nodes to be rendered to an output.
Definition RenderList.hpp:19
Definition GeometryToBuffer.hpp:48
Definition TinyObj.hpp:19
Connection between two score::gfx::Port.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:71