16 halp_meta(name,
"Geometry Info")
17 halp_meta(category,
"Visuals/Utilities")
18 halp_meta(c_name,
"geometry_info")
19 halp_meta(manual_url,
"https://ossia.io/score-docs/processes/geometry-info.html")
20 halp_meta(uuid,
"c4deb797-8d5f-4ffb-b25b-b541f5c54099")
26 halp_meta(name,
"Geometry");
27 halp::dynamic_gpu_geometry
mesh;
28 float transform[16]{};
29 bool dirty_mesh =
false;
30 bool dirty_transform =
false;
36 halp::val_port<
"Vertices",
int> vertices;
37 halp::val_port<
"Indices",
int> indices;
38 halp::val_port<
"Instances",
int> instances;
41 halp::val_port<
"Attributes", std::vector<halp::geometry_attribute>> attributes;
42 halp::val_port<
"Bindings", std::vector<halp::geometry_binding>> bindings;
43 halp::val_port<
"Inputs", std::vector<halp::geometry_input>> inputs;
45 halp::val_port<
"Readable", std::string> readable;
49 static std::string_view semantic_name(ossia::attribute_semantic sem)
51 auto s =
static_cast<ossia::attribute_semantic
>(sem);
52 if(s != ossia::attribute_semantic::custom)
53 return ossia::semantic_to_name(s);
57 static std::string_view format_name(halp::attribute_format v)
61 case halp::attribute_format::float4:
63 case halp::attribute_format::float3:
65 case halp::attribute_format::float2:
67 case halp::attribute_format::float1:
69 case halp::attribute_format::unormbyte4:
71 case halp::attribute_format::unormbyte2:
73 case halp::attribute_format::unormbyte1:
75 case halp::attribute_format::uint4:
77 case halp::attribute_format::uint3:
79 case halp::attribute_format::uint2:
81 case halp::attribute_format::uint1:
83 case halp::attribute_format::sint4:
85 case halp::attribute_format::sint3:
87 case halp::attribute_format::sint2:
89 case halp::attribute_format::sint1:
91 case halp::attribute_format::half4:
93 case halp::attribute_format::half3:
95 case halp::attribute_format::half2:
97 case halp::attribute_format::half1:
99 case halp::attribute_format::ushort4:
101 case halp::attribute_format::ushort3:
103 case halp::attribute_format::ushort2:
105 case halp::attribute_format::ushort1:
107 case halp::attribute_format::sshort4:
109 case halp::attribute_format::sshort3:
111 case halp::attribute_format::sshort2:
113 case halp::attribute_format::sshort1:
120 static std::string_view classification_name(halp::binding_classification v)
124 case halp::binding_classification::per_vertex:
126 case halp::binding_classification::per_instance:
127 return "per_instance";
135 outputs.vertices.value = inputs.geometry.mesh.vertices;
136 outputs.indices.value = inputs.geometry.mesh.indices;
137 outputs.instances.value = inputs.geometry.mesh.instances;
139 outputs.attributes.value = inputs.geometry.mesh.attributes;
140 outputs.bindings.value = inputs.geometry.mesh.bindings;
141 outputs.inputs.value = inputs.geometry.mesh.input;
145 std::string& ret = outputs.readable.value;
148 std::back_inserter(ret),
"vertices: {}, indices: {}, instances: {}\n",
149 inputs.geometry.mesh.vertices, inputs.geometry.mesh.indices,
150 inputs.geometry.mesh.instances);
153 for(
auto& v : inputs.geometry.mesh.attributes)
156 std::back_inserter(ret),
157 "Attribute {}: semantic={}, binding={}, fmt={}, offset={}\n", i++,
158 semantic_name(
static_cast<ossia::attribute_semantic
>(v.semantic)), v.binding,
159 format_name(v.format), v.byte_offset);
163 for(
auto& v : inputs.geometry.mesh.bindings)
166 std::back_inserter(ret),
"Binding {}: stride={}, step={}, class={}\n", i++,
167 v.stride, v.step_rate, classification_name(v.classification));
171 for(
auto& v : inputs.geometry.mesh.input)
174 std::back_inserter(ret),
"Input {}: buffer_idx={}, offset={}\n", i++,
175 v.buffer, v.byte_offset);