Contents
How to make a splash with dynamic 2D water effects?
If you have XNA, you can download the source files and compile the demo yourself. Otherwise, check out the demo video below: There are two mostly independent parts to the water simulation. First, we’ll make the waves using a spring model. Second, we’ll use particle effects to add splashes.
How to create dynamic 2D water effects in Unity?
In this tutorial, we’re going to simulate a dynamic 2D body of water using simple physics. We will use a mixture of a line renderer, mesh renderers, triggers and particles to create our effect. The final result comes complete with waves and splashes, ready to add to your next game.
How are waves made in a water simulation?
There are two mostly independent parts to the water simulation. First, we’ll make the waves using a spring model. Second, we’ll use particle effects to add splashes. To make the waves, we’ll model the surface of the water as a series of vertical springs, as shown in this diagram:
How is the dynamic pressure of a water wave governed?
The dynamic part of the pressure undergoes an exponential decay in amplitude with depth. This is governed by the wave number k, so that the dynamic pressure is quite low below even one-half wavelength in depth: the factor is e−π ≈ 0.05. Particle motions become circular for the deepwater case.
How to make water appear as a wave in Unity?
We’re going to render the top of our water using one of Unity’s line renderers, and use so many nodes that it appears as a continuous wave. We’ll have to keep track of the positions, velocities and accelerations of every node, though. To do that, we’re going to use arrays.
How are NSMB splashes different from normal splashes?
However, in NSMB the water also has constant waves on the surface, and the splashes look very different. Another difference is that in the tutorial, if you create a splash, it first creates a deep “hole” in the water at the origin of the splash.
How are particles used to make a splash?
A particle effect uses a large number of small particles to produce some visual effect. They’re sometimes used for things like smoke or sparks. We’re going to use particles for the water droplets in the splashes. The first thing we need is our particle class:
How to make a splashhole smaller in Java?
To make the “splashhole” smaller I would suggest altering the method Splash (int index, float speed) so that it directly affects not only index but also some of the close vertices, so as to spread out the effect but still have the same “energy”. The number of vertices affected could depend on how wide your object is.