15 halp_meta(name,
"Geometry Info")
16 halp_meta(category,
"Visuals/3D")
17 halp_meta(c_name,
"geometry_info")
18 halp_meta(manual_url,
"https://ossia.io/score-docs/processes/geometry-info.html")
19 halp_meta(uuid,
"c4deb797-8d5f-4ffb-b25b-b541f5c54099")
25 halp_meta(name,
"Geometry");
26 halp::dynamic_gpu_geometry
mesh;
27 float transform[16]{};
28 bool dirty_mesh =
false;
29 bool dirty_transform =
false;
35 halp::val_port<
"Vertices",
int> vertices;
36 halp::val_port<
"Indices",
int> indices;
37 halp::val_port<
"Instances",
int> instances;
40 halp::val_port<
"Attributes", std::vector<halp::geometry_attribute>> attributes;
41 halp::val_port<
"Bindings", std::vector<halp::geometry_binding>> bindings;
42 halp::val_port<
"Inputs", std::vector<halp::geometry_input>> inputs;
44 halp::val_port<
"Readable", std::string> readable;
50 outputs.vertices.value = inputs.geometry.mesh.vertices;
51 outputs.indices.value = inputs.geometry.mesh.indices;
52 outputs.instances.value = inputs.geometry.mesh.instances;
54 outputs.attributes.value = inputs.geometry.mesh.attributes;
55 outputs.bindings.value = inputs.geometry.mesh.bindings;
56 outputs.inputs.value = inputs.geometry.mesh.input;
60 std::string& ret = outputs.readable;
63 std::back_inserter(ret),
"vertices: {}, indices: {}, instances: {}\n",
64 inputs.geometry.mesh.vertices, inputs.geometry.mesh.indices,
65 inputs.geometry.mesh.instances);
67 auto to_string = []<
typename T>(T v) -> std::string_view {
68 if constexpr(std::is_same_v<T, halp::attribute_location>)
72 case halp::attribute_location::position:
74 case halp::attribute_location::tex_coord:
76 case halp::attribute_location::color:
78 case halp::attribute_location::normal:
80 case halp::attribute_location::tangent:
86 else if constexpr(std::is_same_v<T, halp::binding_classification>)
90 case halp::binding_classification::per_vertex:
92 case halp::binding_classification::per_instance:
93 return "per_instance";
98 else if constexpr(std::is_same_v<T, halp::attribute_format>)
102 case halp::attribute_format::float4:
104 case halp::attribute_format::float3:
106 case halp::attribute_format::float2:
108 case halp::attribute_format::float1:
110 case halp::attribute_format::unormbyte4:
112 case halp::attribute_format::unormbyte2:
114 case halp::attribute_format::unormbyte1:
116 case halp::attribute_format::uint4:
118 case halp::attribute_format::uint3:
120 case halp::attribute_format::uint2:
122 case halp::attribute_format::uint1:
124 case halp::attribute_format::sint4:
126 case halp::attribute_format::sint3:
128 case halp::attribute_format::sint2:
130 case halp::attribute_format::sint1:
132 case halp::attribute_format::half4:
134 case halp::attribute_format::half3:
136 case halp::attribute_format::half2:
138 case halp::attribute_format::half1:
140 case halp::attribute_format::ushort4:
142 case halp::attribute_format::ushort3:
144 case halp::attribute_format::ushort2:
146 case halp::attribute_format::ushort1:
148 case halp::attribute_format::sshort4:
150 case halp::attribute_format::sshort3:
152 case halp::attribute_format::sshort2:
154 case halp::attribute_format::sshort1:
164 for(
auto& v : inputs.geometry.mesh.attributes)
167 std::back_inserter(ret),
168 "Attribute {}: binding={}, loc={}, fmt={}, offset={}\n", i++, v.binding,
169 to_string(v.location), to_string(v.format), v.byte_offset);
173 for(
auto& v : inputs.geometry.mesh.bindings)
176 std::back_inserter(ret),
"Binding {}: stride={}, step={}, class={}\n", i++,
177 v.stride, v.step_rate, to_string(v.classification));
181 for(
auto& v : inputs.geometry.mesh.input)
184 std::back_inserter(ret),
"Input {}: buffer_idx={}, offset={}\n", i++,
185 v.buffer, v.byte_offset);