Welcome, Guest! Login | Register

Water [Print this Article]
Posted by: Bulk
Date posted: Nov 22 2004
User Rating: 4.5 out of 5.0
Number of views: 20969
Number of comments: 1
Description: A quick guide on how to make that really fantastic looking water from Half Life 2/Counter Strike.
This tutorial assumes you have basic knowledge of Hammer, either from Half-Life 1, or Source engine level design experience. You are expected to know how to place and create brush based entities, and know how to make at least a simple room.

By the end of the tutorial, you should be able to understand how water works, and its limitations.

There is an example map available; however this tutorial will assume you are building it all from scratch.

Zip FileFilename: tut_water.zip
File Size: 5.8 KB

Water is a pretty simple effect to make, however because it is so expensive to render in the engine, there are some limitations that will dictate how you make and use water in a level.

Firstly, there are two separate types of water, "Expensive" and "Cheap". Expensive water is the best looking, but takes up more system resources to render. It will reflect the world, animate the surface, and generally look pretty damn cool. Cheap water, as the name suggests, takes far less resources than the expensive variety. It doesn't reflect anything, and is generally far uglier. Expensive water will fall back to the cheap kind if the card does not support the spiffy features of expensive water, and will be rendered as cheap if the user changes the visual quality settings in the options.

The limitations

In each visibility area (known as a PVS, or Potentially Visible Set), there can only be one water level. This means you can't for instance make a layered pond or something similar. You can however have different levels if the engine can't see one body of water at one level to the other body at the different level.

Secondly, you cannot have expensive and cheap water in the same PVS. You can manually create cheap water by using a material that forces cheap water, but unless you really need to it's not recommended. Who wants ugly water?

Lastly, water cannot slope in the Z-Axis. What that means in English is that you can't, for instance, make a flowing body of water that runs down a slope.

The easy part

Now we come to actually making the water, and that couldn't be simpler. All you need to do is create your brush, cover it in a water material (I like "nature/water_canals_water2". Now you need to cover all sides of the brush apart from the top face with the material "toos/nodraw". Then just give it something nice to sit in (I made a nice outdoor pond in the example map). Note: do not make the brush in to a func_water entity; the shader does all the work.

There remains one last thing to do, and that's creating an entity to control the level of detail for our water. So go ahead and place a water_lod_control entity anywhere in the level. Its settings are pretty straight forward, and I don't think they need explaining here. Note: if you don't intend to change the LOD (level of detail) settings away from the defaults, you don't need to place this entity; the compiler will add it for you if it doesn't detect it.

All you need to do now is sit back and enjoy your water.

user posted image

That's it for this tutorial. It's all pretty straight forward but if you have any questions (or spot any omissions/mistakes), post them in the comments below.

Rate This Article
This article is currently rated: 4.5 out of 5.0 (2 Votes)

You have to register to rate this article.
Related Files
Zip FileFilename: water1.jpg
File Size: 52 KB
Zip FileFilename: tut_water.zip
File Size: 5.8 KB

User Comments Showing comments 1-1

Posted By: [hP] on Apr 06 2006 at 20:00:38
Neat tutorial... Thanks


You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 05 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005


Latest Comments
knock knock
General | News
By: omega | Dec 22 2016
 
knock knock
General | News
By: MIFUNE | Oct 10 2015
 
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
 
knock knock
General | News
By: Whistler | Nov 05 2011
 
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
 
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Persuter | Aug 02 2009
 

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (4 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!