WiseWaterGlass: Water behind Glass

From Valve Developer Community
Jump to: navigation, search


Ingame screen shot.
The three brushes.
The three brushes are in place and overlapping each other.

This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.

Since you’re reading this you have probably created water behind glass only to find that nothing shows from the side views, other than the glass itself. What you need to do is create an illusion, something cloudy or moving.

If you hold up a glass of water and look at it from the side what do you see? Take the same glass and fill it from a river, probably cloudy.

To create this illusion I’ve experimented with many methods available to us. The one that seems to work the best is shown below.

All three brushes are the same size, but they don’t have to be. The env_embers volume only needs to be large enough for the player's view.

trigger_waterydeath isn't available in most Source games, only the Half-Life 2 branch. When the player steps into the water they’ll see, feel and hear, water leeches.

The main brush is for the water itself, but instead of a normal water brush I’ve used func_water_analog for this, textured on all sides with tools/toolsnodraw and the top surface textured with nature/water_movingplane. This moving water entity works great for tanks and renders cheaply. You don’t have to set any properties, since in your tank it’s the appearance that’s needed, not the potential it has for movement.

The only property you need to set for the trigger_waterydeath brush is to check the flag Clients. This brush is entirely textured with the tools/trigger material.

These are the properties I used for the env_embers, but you should experiment.

Density (particles per second) can look nice if set higher and lower.

Adjust the Pitch Yaw Roll (Y Z X) to change the flow of the particles.

One property that can often look better when the tank can only be seen from the front is Particle Lifetime (seconds). On this I’ve set that value to 1.0 but it’s often best at 4.0, however allowing the particles to live for 4 seconds can make the embers flow right out of this tank.

  • Ember type: Smooth Fade
  • Density (particles per second): 38
  • Particle Lifetime (seconds): 1.0
  • Particle Speed (units per second): 18
  • Ember Color (R G B): 201 201 201
  • Flags: Start On

See also