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:
- Research.
- Process.
- Progress.
- 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 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.
After importing the texture, I made the following material:
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.
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:
Required Node:
Spawn Node:
Life Time Node:
Initial Size Node:
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 .
Size by Life:
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.
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.
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.
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.
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.
For time line I used the following values:
After completing this part we connect the two effects together as follows
So you should have an end result as the following:
Comments
Post a Comment