Trying to use RhinoInside for animation. Want to zap vertices to GPU and render, quick way would be to pass array data/length to my C++? Trying to avoid hidden costs or duplication of effort. Can pass ^double_array then loop over that in C++ but not ideal.
Interop.NativeGeometryConstPointer(g).ToInt64() ? Or is there help in the world of ordinary C#?
Followed Facade/Native C++ example from CSharpCorner blog below (as per RhInoInside samples, create a C++ CLR DLL, and C# console app, add reference to the DLL, no P/Invoke) and got vertices from GH to RhinoInside to my C++, but copying/reinterpreting data so not ideal.
// C#
getter.SendLines(double_array, n, line_lengths_array, num_lines)
// C++
void SendLines(cli::array<System::Double>^, System::UInt32, cli::array<System::UInt32>^, System::UInt32);
Saw Alea posts (Cuda#? actually F#) but nooneâs mentionned Vulkan?
To get Point3dâs into the GPU developers can code RhinoInside or code Grasshopper components to do it directly with GL, DX, Vulkan, Cuda memory transfer, etc. May as well stream vertex data to GPU from there instead of running a GH definition and extracting piecemeal.
More optimal yet presumably is making (kind of âbakingâ?) entire definition that wonât change during use into one hard-coded GH component, probably other savings like allocating memory once on reset exist.
Using a parakeet kaleidoscope GH example definition resulting in lists of polylines - main bottleneck originally was misunderstanding RunGrasshopper sample and trying to use that approach for repeated generation of lines.
Now making RhinoInside C# update inputs, mark all downstream for recompute, recompute but then (bottleneck for bigger data) iterating and extracting the geometry, ie copying, to pass on to C++.
Probably better to switch to one list of âline stripâ points (triples of doubles) and one âlengthsâ list (number of verts in each separate line).
And I imagine GH component also probably best place to stream vtx data from?
Anyone RhinoInsiders already succeeded at this? Thx in advance