Skip to main content

Interactive realistic water ripple effect with dissolving material

By Mayank Babbar
Introduction:
The original aim of this project was to have interactive water ripples with the player or any moving mesh in 3D space. To achieve this goal, I subdivided this project into the following 4 phases:
  1. Research.
  2. Process.
  3. Progress.
  4. Execution.

Each of the above phases were treated as calculated time sensitive variables and were executed within the give time frame. Following is my timeline for each phase.

Week Number
Dates
Phases
1
3/31 - 4/4
Research
2
4/7 – 4/11
Process - Progress
3
4/14 – 4/18
Progress -Execution
4
4/21 – 4/25
Execution- complete
5
4/28 – 5/2
Submit

Phase 1: Research
In this phase I researched on many games characters moving through water mesh.  I took references from the uncharted series, Tomb raider and others. After observing how water would react, I looked for tutorials online. They are as follows.

How to make interactive water ripples with moving mesh


How to make dissolvable material


These tutorials helped me to understand how to make water ripple effects cheaply and what effects I should use to make it look better.  There are quite a bit of issues in these tutorial you will see and one of the biggest one is that they are speed through tutorials; therefore, you are bound to miss a small node that will result in failure of execution.
In order for this to work I will attach screenshots and values I used to create this effect.
To start off, we start with making realistic water ripple effect.
Step 1: Create a project
I created a 3rd person player project which I felt would be good enough to showcase my choice idea.  Regardless, this project can be executed in any project you wish.

Part 1: Interactive water ripple effect with no water plane
Step 2: Creating Material
To create this material, you will need to create a cylindrical alpha and texture alphas  as shown below. The  both alphs are 512x512 texture space and is the only texture you will need in this entire tutorial.
\\homed\mbabbar\Windows\Desktop\tut\alpha ref.jpg\\homed\mbabbar\Windows\Desktop\tut\Dissolavlble\512x512.jpg
After importing the texture, I made the following material:
\\homed\mbabbar\Windows\Desktop\tut\mat_1.jpg
In the above material you can see that the difference between my material and the tutorial is that I added a default particle color, which actually goes a long way. The one minus node helps invert the alpha and gives it the shape that we need for ripple effect.
Step 3: Effect Particles
After creating the material, we will move on to making the particle effect that does the magic.

\\homed\mbabbar\Windows\Desktop\tut\Untitled-1.jpg
There are couple of ways where, you can view you material responding to cascades environment.  Either you can turn on the bounding box that will show you how the material behaves in cascade you  can change the background color  to see the behavior and changes to the particles.
Following are the values I used in cascade.
Mesh Data Node:
\\homed\mbabbar\Windows\Desktop\tut\meta data_1.jpg


Required Node:
\\homed\mbabbar\Windows\Desktop\tut\required-2.jpg

Spawn Node:
\\homed\mbabbar\Windows\Desktop\tut\Spawn.jpg

Life Time Node:
\\homed\mbabbar\Windows\Desktop\tut\Lifetime.jpg

Initial Size Node:
\\homed\mbabbar\Windows\Desktop\tut\initial size.jpg
Color Over life Node:
Just a heads up, here I played around with the graph on cascade. The values used here were in the life multiplier on x and y axis.  At time 0.0 the value for y axis was 0.0, and vale on x axis at time 0.0 was noted down to 0.20. At time 1.0 both values od X and Y axis were placed at 0.80 these values are used to make the ripple effect .
\\homed\mbabbar\Windows\Desktop\tut\color over life_1.jpg
\\homed\mbabbar\Windows\Desktop\tut\color over life_2.jpg

Size by Life:
\\homed\mbabbar\Windows\Desktop\tut\size by life.jpg
Init Mesh Rotation
This node was used to keep the rotation of the alphas in a locked axis to where the pplaye or any mesh moves. As seen below.
\\homed\mbabbar\Windows\Desktop\tut\Initial mesh rotation.jpg

After creating the particle effect we guide ourselves to  the level blue prints.
For having the effect follow the player we start with event tick connect it to delay at 0.25 after which we pull out a string  spawn emitter location and select our water ripple emitter.  Then we take our target mesh (character BP) reference from the   scene and we get function location of the character BP  and connect it to  location  at spawn emitter at location node.
\\homed\mbabbar\Windows\Desktop\tut\level bp_1.jpg

PART 2 : Dissolvable Material
For The second part of the project I created a dissolvable material that when a player walks into a trigger box the material dissolves making player or character invisible.
So for starters we can use any alpha for this material. I created one alpha using a water texture from CGtextures.com website (free to use). This is the same alpha that was used in Part 1 of the tutorial.
\\homed\mbabbar\Windows\Desktop\tut\Dissolavlble\512x512.jpg
After this step we create the dissolvable material as follows, please note that I have followed a tutorial for this which is at the top links. It’s also good to note that I have played with values.
\\homed\mbabbar\Windows\Desktop\tut\Dissolavlble\mat_2.jpg
So let’s start with few terms that we don’t normally use and what they meant for this material.

As you can see I have used quite a bit of ifs in material as I was following the tutorial I realized that the if nodes help  in dignifying how the material will behave. For example,   if we are using 2 values for A and B, we can use the if node to delegate how we want the material the behave based on these values. The if node contains 5 basic concept that helps us to achieve our goal using if equations.  The first two in the IF node are basic inputs for 2 values, the third input states if A is greater than B then, the input value that should be taken into consideration. The forth input in the node is if A is equal to B we can give it a separate input value to go with that equation and last input is A is less than b, we can assign a separate value to it.  I also used texture coordinate to multiply u- v scaling of the texture .
After making this material  can draw out trigger volume to the scene. And go to level blueprints  and do the following.
\\homed\mbabbar\Windows\Desktop\tut\Dissolavlble\lvlbp3.jpg

For time line I used the following values:
\\homed\mbabbar\Windows\Desktop\tut\Dissolavlble\timeline.jpg

After completing this part we connect the two effects together as follows
\\homed\mbabbar\Windows\Desktop\tut\Dissolavlble\level_bp _final.jpg
So you should have an end result as the following:

Comments