16.8.2019 – Jussi Kemppainen
It has been a little while, since I last posted a water related upddate. So..
Water related Update!
Gushing water. that is where it’s been at this week!
We are redoing some of the levels from the game that we feel have not been up to par with our current understanding of fun game-play. And this week it was the turn for our dreaded underwater temple to go! We saved some of the super complicated trigger work, but about 150% of the level content was scrapped and redone from scratch. This sort of total overhaul has been done to a bunch of our level content in the last month or so.
But back to the topic. As we were redoing the water temple. I got super exited to add a bunch of gushing pipes and whatnot to the level. And they need gushing water, so this is how we went about creating that effect!
Element 1: The shape of the water
In this example I’ll be showcasing a simple water faucet type of effect, so the water shape is simply a cylinder. It is actually 2 cylinders inside each other.
The inner cylinder is an animated material with gradual alpha cutoff value going to the bottom. When we are animating the diffuse channel UV the image never clips at the bottom as it is faded out. This is representing the foams and air gushing within the water.
The outer cylinder is the water surface. This is rendered transparent in play mode (when the game is running) with animated normals and distortions. This represent the surface of the water and will be hidden once it intersects with other waters, creating an unified water surface.
Element 2: the surface collision
The surface impact is split into 2 parts: particles that spawn on collision (I will explain that bit in the next chapter) and a mesh and some particles that are placed on the surface by hand.
The manually placed assets are a particle emitter just spewing out water splashes and a similarly animated alpha-cutoff shader as with the inner cylinder. but instead of being a cylinder, it is an outwards expanding disk. Allowing us to animate the foam spreading out from the impact point.
Element 3: The particles
One master particle system is in charge of creating the base for all of the particles. Once this system collides with a water surface (or floor) we spawn slow dispersing steam particles and distortion rings that add life to the surface that is being impacted on.
When combined, these elements create a nice gushing water effect that can be used with pretty much any shape we wish.
I am also a fan of the internal cylinder with the foam texture being visible under other water surfaces all alone, as it gives an impression of violent current churning in the deep.
It looks even better animated but my mother never taught me how to capture GIF or video from windows screen in Unity editor.