Niagara Fluids: capturing simulation results into volumetric textures

Dear all,

I have been working on the Niagara Fluids simulations for the representation of combustion in forest fires and the production and dispersal of smoke plumes. Since my interest is to show the resulting scenarios in virtual reality environments, it is very computationally expensive to calculate each time the CFD solution in real time.

That is why I have been investigating ways to capture the results of CFD simulations of Fluids, in particular how to capture the Render Target Volume that is generated (SimRT) from the 3D calculation grid (ScalarGrid), which stores information about the density (channel R), temperature (channel B) and transmittances of sunlight (channel G) and fill light (channel A), and try to read them externally in a Blueprint to store them either as a RT or as a volumetric texture in the Content Browser. That way, in subsequent simulations, I only have to load the volumetric texture into the corresponding Raymarching material, without having to recalculate the entire CFD simulation which, as I say, is very expensive in time and GPU memory.

The good news is that Niagara has already a data interface for Render Target Volume variables, but to my surprise and despair it only offers a Set node to set the variable from a Blueprint, but not a Get node to read it! That is, despite the fact that the communication channel is already created (RT data interface) Niagara does not allow me to read the generated RT variable and use it in Blueprints. How can that be possible?

And that’s my question: how can I capture the results of the Fluids simulation stored as RT in an asset that can be reused later as a volumetric texture?

As an alternative, is it possible to convert the scalar simulation 3D grid (ScalarGrid) into a Vector4 array and transfer it to Blueprints via an appropriate data interface (Vector4 array)? It could be a solution, but it seems weak and very slow to me.

I’ve also explored using the sequencer in UE 5.2 for Niagara Fluids, but unfortunately it doesn’t free me from computation and GPU RAM usage, i.e. it doesn’t do what I want: capture the results of the simulation and store them as a sequence of volumetric textures. It just relaunches the simulation and that is very slow for a VR application.

Does anyone of you have any ideas on how to face this challenge? Is there any other tool or approach that I can use for such a purpose?

Any help or suggestion will be very welcome, since I am in a dead end.

Cheers

David - Gnomusy

1 Like

It sounds like you want to cache your fluid. Maybe take a look here for how to do this:

This will let you playback the sim results without actually running the simulation. Playing back the sim cache is much faster than the original sim. There is also the Niagara Baker, but that only works in the Niagara Editor, so it is a bit more limited.

2 Likes

That’s much appreciated Devon. BTW, I am mostly impressed by the work you’ve done in UE 5.3, particularly the flawless implementation of volumetric sparse data for non-geometric bodies. I also appreciate the effort to include light scattering in the simulations, this is something I was waiting for with genuine interest. Just missing some of the Rayleigh scattering over the albedo, you know, this bluish effect of smoke when observed against dark backgrounds, maybe for the next version.

For all this, Devon, a thousand thanks.

David - Gnomusy

You’re welcome- a lot of that is a team effort with Tim Dörries recent work on SVTs and Patrick Kelly writing all the rendering code.

1 Like