15 mars 2018

Houdini Fluid test

I wanted to try some Houdini fluid and test how i could bring that into a game engine.
My goal was to bake the velocity information into the vertex so i wouldn't have to bake the velocity in a texture.



I started by creating a fluid simulation in Houdini. 
For that i exported a part of my world from the engine and imported it in Houdini. 

Just using a bunch of mesh to create my sim was not great so i decided to create a shell from all those meshes. 

Here i am using a ray with a high density plane but converting all mesh to VDB then converting it back to poly could be a better solution. 

After creating my fluid i picked a frame i liked and converted it to a mesh (using remesh so i could control the mesh cost)

I then used the particle data to calculate my velocity and other attribute for foam.

Once i calculated my velocity i pushed the value into the vertex.

And i made a  shader using the vertex color to control how the texture will flow. 
I also added some vertex animation to get a better result.


Conclusion:
It works, that's great but the process is quite heavy. 
Having information in the vertex means that Lods can create issues, also the mesh needs to have enough density to have the information.