Water Examples

title_Water.png

The following Particle Systems are the water effects that were created for this example. You are encouraged to open these up in Cascade to see how each effect was assembled.

For more information on Cascade and Particle Systems, please see the Particle Systems documentation.

Waterfall

WaterfallSection.png

Content Browser Location: Game/Effects/Particles/Water/P_WaterFall

The Waterfall effect combines multiple Materials and Particle System settings to simulate the effect of water cascading down a rock formation. Of particular importance in this effect is that camera alignment plays a significant role; the player is not intended to walk right up to the water, but rather to view it from a small distance.

Because these particles are using a translucent Material, they do come with an overdraw cost - meaning that many drops will have to render on top of one another. However, since they are GPU Sprites, the actual simulation (tick) cost is very low, since that is passed off to the GPU. Using this method, we can get much more complex and interactive behavior than we would if we created the effect using Materials and Static Meshes alone. The two techniques could be combined, however, for further variation within the effect.

Collision

CollisionWithRocks.png ModuleStack.png

As the water falls down the rock face, you will notice it splashing and colliding with the surface. This is done using a Collision (Scene Depth) operator, which is only available to GPU Sprites. This uses the Scene Depth G-Buffer to calculate collision surfaces and incurs only a minimal performance cost.

Particle Color

It is important to keep in mind that GPU Sprite particles do not support Dynamic Parameters, which are typically used to send data from a Particle System into a Material. Because of this, we have employed some trickery, using a Particle Color node within the Material. Typically, this node allows us to change the color of the particles as they fall, by animating their color and alpha values across their lifespan. Here, however, we are using that Red, Green, Blue, and Alpha (RGBA) data to drive a few more things. Since the water does not need to actually change color (water is colorless, after all), we use the Particle Color data in the following manner:

  • Red - Drives refractive index of the water, or how much it bends light.

  • Green - Drives the actual color. This means that the Green channel is driving all RGB data for color, which gives a grayscale result.

  • Alpha - Drives opacity of the water.

If you check out the Material (named M_WaterDrop_SubUV), you can see the Particle Color node driving these values as described.

Click to see full size.

If you open the P_Waterfall Particle System in Cascade, take special note of the Scale Color/Life module. The color animates to super-bright (greater than 1.0) for the first half of the lifespan, while the alpha ramps from black to white, then gradually falls back off to black. The result is a clean fade in and back out, as seen below.

ColorAlphaAnimated.png

Splash and Ripple Effects

SplashRipple.png

Content Browser Location: /Game/Effects/Particles/Water/P_Drips_Splash_Ripples

This particle effect handles both dripping water and a splash/ripple effect as the drops strike a water surface. This is done with a series of different emitters within the particle system. A series of emitters handle the effect of falling water, another simulates the upward splash as the drops strike the pool beneath, with a final type of emitter handles the radiating ripples along the water's surface. This means the effect is ready to be placed over any stationary water surface and give a realistic effect.

The Particle System also uses a Lit Translucency Material that is utilizing a Particle Color node to drive opacity. This allows for the Particle System to control its own opacity by way of a Scale Color/Life module. In this case, the alpha has been animated to be nearly opaque near the beginning of the particle's life, meaning that it is highly receptive to light influences.

FallingWaterDrops.png

In the screenshot above, notice that many of the falling particles are bright white near the top of the image. At first, this appears to be a natural phenomenon due to the blooming white highlights near the particles. However, this is only possible because the particles are literally being told to be more opaque at that point in their lives, thus using more of the level's lighting.