WiseWaterGlass

From Valve Developer Community
Revision as of 15:59, 9 February 2008 by Plykkegaard (talk | contribs) (Added wrapup)
Jump to navigation Jump to search

Water behind Glass

In game screen shot

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 Players view.

trigger_waterydeath is not for CS:S or DOD:S but it’s a nice addition in HL2. When the Player steps into the water they’ll see, feel and hear, water leeches.

The three brushes

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 nodraw 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. The Density can look nice if set higher and lower. Adjust the direction of the ember flow from the Properties. One property that can often look better when the tank can only be seen from the front is Particle Lifetime. 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 will let the embers flow right out of this tank.

the three brushes are in place and overlapping each other
  • Class: env_embers
  • Ember Type: Smooth Fade
  • Density: 38
  • Particle Lifetime: 1.0
  • Particle Speed: 18
  • Ember color: 201 201 201
  • Flag: Start On

There are full tutorials on the site for normal water and moving water.

Wrap up

There’s a lot more you can do, hopefully this article have stimulated your imagination.

Credits

The tutorial is originally created by wisemx, it is ported from sdknuts.net/wiseWaterGlass to the VDC by Peter [AGHL] 21:03, 8 Feb 2008 (PST)