I am trying to implement a marching cubes algorithm in Niagara, and I am struggling to export my calculated triangles from Niagara to my blueprint where I pass them to a procedural mesh component.
While doing research, I came across the “Niagara Get Int32 Array” Blueprint Node, but I cannot seem to get it to work. The only way I can get any valid results is when I try and retrieve a User Int Array. This sadly is of no use for me since I cannot set the Array to any values inside the Niagara System.
I am also aware of passing Particle Data, via Basic Particle Data Export, but this does not support Arrays.
My Question is how do I use this node correctly? Is there a way to retrieve Niagara Arrays from a Blueprint ? Or will I have to write it to a Texture and sample it with a Shader?
Any Help would be much appreciated, since the documentation is lacking heavily in this area
as my question states, it is only possible to set and modify *User exposed * arrays. Anything in the System, Emitter and Particle Namespace is read only for blueprint. There are two ways to get variables from Niagara Systems, either through using the Export Particle Data module ( see content examples Niagara Advanced map for usage, limited only to two vectors and a scalar parameter) or through using GridCollections . The latter can be used to store and manipulate data, which can then be encoded to a RenderTexture during runtime. The texture can then be read by a shader or a blueprint. The caveat here is that the blueprint function ReadRenderTargetPixel is horribly slow and inefficient and blocks the main render thread, so I would write my own function or try and create a compute shader to parse incoming data.
I hope this helps somehow, if you need further clarification, just let me know.