VFX breakdown ! How to make a waterfall ? ~ Particles & Nodal Shaders

Hello there !

Do you like VFX, particles and animated materials ? Well, you are in the right place !

Here is a little breakdown of this tremendous bloody (water)fall that I did for our game Abortion Boy ! It's a really gore game, so I had to make blood and flesh VFX, enjoy~

Look at this cutie

BloodWaterfall.gif

So, shader first !

First of all, I started from a 3D plane and made this really simple mesh with the soft selection tool in 3DS Max. Mesh.PNG

The most important part when you're making your waterfall mesh is to tweak your UVs like on this screenshot, because we'll have our waterfall texture that will be panning on our mesh, and because the UVs are less stretched at the bottom of the mesh, this will give us the feeling that the texture accelerates over time (we can see it on the next gif).

MeshUV.PNG

BloodWaterfall02.gif

Well, we have our mesh ! Now, as you can see on the gif, we have a panning texture. I took some water texture, painted it in red, and made it tileable with photoshop offset and the stamp tool :

Texture.PNG

But from now, how to use this texture in Unity ?

That's the Shader magic !

I'm not a HLSL/CG language user, so I use a node based shader editor called Amplify to make my shaders.

First of all, I'll need to distort my texture to make it more realistic. For this I use 2 normal maps that I will blend together :

Screen01.PNG

Next, I make the normal maps pan, by using a float2 to control the panning on both X and Y axis :

Screen02.gif

After that, I need to blend them together, by using a linear interpolation node :

Screen03.gif

Finally, I lerp this new texture with the UVs of my main texture !

Screen05.gif

With this shader, I'm now able to tweak and modify values & properties and texture through the Unity inspector :

Screen07.PNG

Noice !

I have the base of my (water)fall ! Let's add some particles !!

BloodWaterfall03.gif BloodWaterfall04.gif

So, my main particles are affected by a really simple dissolve shader.

First, I need to substract my texture with the opacity of the particle system (in the shader, we can access the particles properties with the node Vertex Color)Here, the opacity of the particles are saved in the alpha channel of the Vertex Colors. Then, I'm also creating a greyscale mask, to define the borders of my texture.

ScreenNext_01.PNG

After that, I multiply my texture with a color, so I can tint it if necessary; and also by the Vertex Colors RGB properties, to tint them directly in the particle editor.

ScreenNext_02.PNG

Back to my mask, I create a float to adjust the global opacity of my particles. The softness parameter is really useful : it will let me create a binary black & white mask (0, black; 1, white), that I will use to dissolve my texture : If I tweak the opacity parameter in my particles, this will adjust the limit between black and white values, instead of acting like a standard fade out.

ScreenNext_03.PNG

Here it is ! My shader is complete !

And now, I need to configure my particles to act like they do on the gif !

The most important properties are the starting properties (like lifetime, starting size, rotation, gravity..), and also the color over life (to make them fade), rotation and size over life. Try to always make some kind of randomness in your properties (for example, give a range of start size/lifetime, and not a fixed constant)

ScreenNext_04.PNG

With my shader that is linked to my vertex colors, and the mask that I made in Amplify, the opacity of my particles will dissolve my texture.

That's all folks !

I really hope you liked this little breakdown, and I'm really sorry because it's a bit long ! Don't hesitate to ask me any questions if you want, or if you didn't understood something !

And if you want, you can test our game here (but care, it's really gore and tortured) :

Abortion Boy !