TheReturnal global airflow/fluid simulation

Hi everyone,
For 2022, I really want to dive into fluid simulation at runtime with Unreal and Niagara. With that said, I’m currently gathering some references, documents, tutorials, or anything alike related to fluid sims.

The Returnal VFX Breakdown is one of my main references for this year training, mainly for what they refer to as “Global fluid simulation” that influence all VFXs in the game.

I’ve found some knowledge about Unreal/Niagara fluid simulation at runtime already, but I’m struggling to find something similar to the 3D “airflow” system that can be seen in The Returnal Breakdown. The idea is to create a vector gris that will be influenced by actors and then use it to control spawned VFXs variables depending on vector direction and strengh (as far as I understand it).


Any link to documentation or talk about this kind of feature would be really nice to have, if any of you have something to share :slight_smile:

I also plan to look into FluidNinjaLive later, but to begin with I really wanted to start by acquiring some knowledge about features like this one I’m looking for or like Niagara simulation stages before using a dedicated tool without understanding at least a bit how it works.

Thanks in advance for you help everyone, and feel free to ask if something is not clear enough! :wink:

14 Likes

Cool stuff! After watching that, I’m pitching replicating some of that to folks at work.

As far as I can tell, the global fluid simulation runs on a low-res voxel grid which updates continuously. UE’s built-in hair strands system has something similar. If you dive into the guts of it, you can see how it works. Basically, there’s a voxel grid which is updated each tick in Unreal, and then sampled in the hair dynamics. That allows the hair to have wavy motion.

The Niagara systems are somewhere in the hair strands plugin… don’t remember off-hand exactly where.

2 Likes

Thanks, that’s a really good first lead to find what I’m looking for! Looking inside UE’s built-in hair systems didn’t came into my mind at all for this. And I agree with you, there’s a chance I’ll find some clues for my question.
Will give it a look :wink:

1 Like

You could maybe paint the velocities into a render target and then read it from the particle system. There is a niagara module for sampling psuedo volume textures, though I haven’t used it. The tricky part might be recentering periodically as the player moves around.

1 Like

I see what you mean, but with this way of doing thing, I don’t know if actor interaction (player movement, projectiles, ect) will be working as well as with some real 3D grid.
Thanks for the idea no matter what, this could be another ways of doing thing if the first idea doesn’t work :wink:

Here’s where to look. This is the Niagara system which powers the hair sim:
Engine/Plugins/Runtime/HairStrands/Content/Emitters/GroomSpringsSystem.uasset

Within that, look at the simulation stages near the bottom:

That’s the fluid sim solver part. The modules call custom HLSL code which is in various files, here:
Engine/Plugins/Runtime/HairStrands/Shaders/Private

(I worked on hair stuff for like a month and a half… found all the files eventually… :slightly_smiling_face: )

4 Likes

Here’s a few links (that you probably know already, but let’s keep them here for everybody else to see) to add to your stash.

Keywords: NeighborGrid3D, Grid2D Collection, SimulationStage, vector field.

Returnal - there will be a dedicated session about their particle system during GDC 2022.

Learn how Housemarque used their programmable particle system to create key vfx features in Returnal. Covering aspects such as volumetric fog driven by realtime fluid simulations and usage of particle hierarchies for character effects such as tentacles.

Good presentation on realtime simulation in UE:

I didn’t dive into UE5 yet, but seems there’s more useful stuff for this type of workflow:

Additionally check “Advanced topics” section on Andreas Glad’s wiki: Tutorials | RealtimeVFX Wiki | Fandom

For “airflow” I suspect a combination of vector fields might do the trick, one can be attached to player and influence global state of affairs.
Project Borealis (HL2 Episode 3 fan project) went with vector fields, be sure to check PDF from website: Wind and Air Drag System | Project Borealis

4 Likes

Thanks a lot for your reply!
As you said, I already found most of those links you’re sharing, but that’s a good thing to keep them all together in here for other users :wink: The keywords you’re giving will be usefull for my futur research, thanks for that too!
And even if I had most of them, I didn’t find the last one by myself yet. Never heard of project Borealis before, I’ll look for it now that I know :slight_smile:

And I saw yesterday the news talking about Housemarque giving a lecture at 2022 GDC, I look forward into that! In the meantime, I found on their website some article about their VFX in complement to the video breakdown they made : RETURNAL VFX BREAKDOWN — Housemarque

1 Like

Hi there, it’s been a while since the last time I posted in here but I wanted to share a bit of the knowledge I’ve found lately.
Those past few mounth, I’ve been doing a lot of research and thinking about this “Globalised airflow/fluid” I was talking about it my very first post. First of all things, I want to thank all of you for your help ! All the guidelines, keywords, links shared inhere were very helpful to have a starting point for my research on the subject.

The past 3 mounth, I’ve been searching for as much usefull documentation and knowledge on the subject, while trying to grasp how render target works in Unreal (because it appeared to me like a basic knowledge to have before going further). Since there is actualy not much documentation on the main-subject (globalised responsive 3D fluidsimulation pipeline) I could find, it resulted in a long list of tutorials, documentations, talks on several sub-subjects that I found interesting for me to learn.
(Spoiler: this will be a long post, sorry in advance for the mess)

To begin with, in addition to TheReturnal VFX breakdown (link in the post above), the Ghost of Tsushima VFX breakdown really is full of interesting topics and hints:

I’ve found several channel of maths popularization that seemed pretty nice for a first overview from a stricly theorical point of view. Here are some talks and documentation about fluid simulation I’ve found:

For render target, I’ve found Dokipen’s damage accumulation video series and Simon’s work on recording flipbook at runtime really helpfull (in addition to the ContentExample project related map). Here are direct links to those two:

For texture sampling in Niagara, the topic was covered by several different youtube chanels (GamedevOutpost, SemSchreuder, TharleVFX), choice is yours:

Regarding Grid2D feature in Niagara and advection principles, I’ve found 2 main knowledge providers in Dokipen and Andreas Glad (still in addition to the ContentExample project example in NiagaraAdvanced map):

Concerning the NeighborGrid3D feature, except for Asher Zhu content, I didn’t find some really noticeable video tutorial. On the other hand, the ContentExample project is full of example using this specific feature to learn from:
NiagaraAdvancedParticle map → examples 3.1 / 3.2 / 3.4 / 3.5
Plugin/NiagaraContent/DefaultAssets/templates/BehaviorExamples → GridLocation (emitter)
Plugin/GroomContent/Emitters → GroomRods (emitter) (thanks to @FRGFX for the idea)

I’ve found a lot of knowledge about Distance Field (that seems to be a really cool feature btw). To begin with, to understand a bit more how this feature works mathematically and why it is so powerful (to say something else than “magic” aha) I highly recommand to look at this talk from David Hill, Wyeth Johnson and Bill Kladis on Maths for artists (link to the related sequence):

Other than that, there is some content ready to watch content to know more about to actualy use those inside Unreal in addition to the official Unreal documentation:

I hope all of this gathered knowledge will be usefull to someone. :innocent:

I’ll be getting back to my learning process (when I find time for it), and hope to come back here soon to share some results and my plan for next steps (too much messy to be shared for now :roll_eyes:)
Hope you enjoy the reading, see you soon, and may the VFX be with you as usual guys! :grin: :sparkles:

16 Likes

Thank you for collecting all these resources! <3

1 Like

I’m no graphics programmer but I read trough this paper because I find it interesting, since I found they based their Voxelizer on this
https://hal.inria.fr/inria-00345291/document

Are there any plugins or implemented examples of this?

Jose Moreno has got some really nice twitter threads running through the setup for a fluid sim in Niagara

2 Likes