Wednesday, November 19, 2014

Visual Effects 2: Houdini Fluids Final

My final project for this month in Visual Effects was to create any effect in any program we desired. I decided to branch out and continue using Houdini to create fluid effects. I decided to stick with the subject I've used throughout both Visual Effects classes; Deadpool. To keep with the random and silly style, I decided to create a water balloon dropping and splashing on Deadpool, spraying water everywhere around him.

To start, I quickly posed the Deadpool rig I created (See it here!) and also modeled a water balloon in Maya. I imported those into Houdini using Geometry nodes and replacing the files. Along with this, I brought in the texture for Deadpool, as well as a wall and floor texture that I placed on flat planes.


Some textures do not show up in the viewport

Next, I placed the water balloon geometry above the character and applied gravity to it. This allowed it to fall like it would in real life. When I found how far the object would fall over a certain period of time, I deleted the gravity on it and hand-keyed the motion. By not leaving the gravity on the balloon, I am able to make sure Houdini doesn't do extra calculations for a rigid body that will be hidden very quickly and won't even be seen. I also keyed the shape of the water balloon so that, as it came in contact with Deadpool's head, it would squash a bit so it didn't just explode the second it touched his head.



Now that the easy stuff was taken care of, now it was time to create the fluid effects. I simply created a duplicate of the water balloon and turn it into a fluid. By doing this, the new balloon-shaped water received gravity, which allowed it to fall down. I also turned Deadpool into a static rigid body, meaning the water will collide with it. One big problem that happened by dropping the water from the highest point is that, by the time they actually hit Deadpool, the water would disappear in air. To fix this, I decided to lower where the fluid dropped from and made it hit the head at the exact same time as the actual balloon. When these were timed right, I set it so that right after the balloon squished for two frames, the balloon would turn invisible and the water would turn on, so it appears like the balloon had popped and released the water.


Frame showing the balloon falling, and switching into the water

I now added white water to the fluid to give the water a splash effect after hitting Deadpool's head. Now came the worst part of this project... The waiting. Houdini's fluids come with a "Particle Separation" setting, which turns up the quality of the fluids. While this makes the fluids look amazing, it also cranks up the simulation time. At its worst, one frame of the simulation took over 20 minutes.

I tried for over 24 hours to create a memory cache, or running through the simulation once, and Houdini will continue to use that cache for as long as Houdini is open. This worked, until Houdini crashed every single time. I eventually gave up on this method and resorted to using actual cache files. This process actually ran A LOT faster than a memory cache, and actually saved the fluid motion. This cache only took about 5 hours to complete, and worked perfectly! The downside? Now I have a folder of almost 35 GB of cache data!

Once everything finally worked the way it was supposed to, I quickly ran a Flipbook test to see how the particles moved together smoothly, which I believed was realistic looking (though it does look like a mess because of the whitewater and spray). This low-quality version of my final render assured everything was working.



With everything finally working the way it was meant to, I set my scene to render at high quality. After 10 hours of waiting for the render to finally finish, I was given this final result below!



This project was a test on its own, and really pushed me to my limits. I played with a program I've barely used for a couple months to create a realistic water simulation, and it was very stressful. But after a week of work, and 35 hours of waiting for simulations, caching, and rendering, I'm very happy with what I have! I hopefully won't have to touch Houdini for a while, or ever again!

- Drew