Download

Passing an array of bytes or floats to Niagara?

I can’t seem to find any way to feed an array of bytes or float to Niagara, besides using a Texture as a mean of communication, which is quite expensive and not the right tool for the task. I have a set of depth information that I have to use as particle depth position, and I can’t see any docs about how to do that. I tried to see about grid2d collection, but little to no documentation exists about that either. :frowning:

Well, Niagara is a system that runs on the graphics card, so texture data is usually the way you send array of bytes there…

Which was my first approach, only to hit the other wall (see my other post) which is that there is no documented way to update a texture at every Tick. I did found a few approaches (all very different for odd reasons) but all need to end with a call to UpdateResource() which causes a huge drop in frame rate: just cannot be done at every tick :frowning: I’ve been around UE4 for years, never having need to get close to the rendering system: now I have to and I found very frustrating that there is zero documentation around the whole rendering system. All the functions barely have a comment in the description stating the obvious (the function name 99% of the times!) and no guidance. It’s a shame, really.

So Bruno, any chance you know how to update a texture at every Tick without dropping from 160FPS to 10?

I never had to do that either, I think you need a material shader to process your data instead of running Cpp code in game thread.

I’m afraid that won’t work because the dynamic material shader would expect a texture as a parameter, and generating such texture at every frame that is indeed the challenge. I guess the only way for me is to study the media player code in the engine to understand how they do that, but it’s really a pity to have to force people to study the engine code instead of its documentation :confused: