Fr/Adding Water: Difference between revisions
< Fr
Jump to navigation
Jump to search
Anarkia777 (talk | contribs) No edit summary |
Anarkia777 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
== Requirements == | == Requirements == |
Revision as of 11:19, 21 November 2008
Requirements
To make it perform efficiently, water also has a collection of rules regarding its placement and usage inside of a map.
- There may be only one water level height in a PVS if the water is expensive.
- "Expensive" and "cheap" water may not be used simultaneously in the same PVS.
- The water's surface should never slope in the Z-axis; it should always be parallel to the horizon line in a map.
- Water is created by applying a water material to the top-most surface of a brush, while covering the remaining faces with the
tools\toolsnodraw
material. - The water_lod_control entity controls the distance at which expensive water transitions into cheap water.
- An env_cubemap entity must be present for the water surface to render properly on sub-DX9 hardware.

Construction
To add a water volume to your level, follow these steps:
- Create a brush the size of the water volume using the Block Tool.
- Open the Texture Browser by clicking the Browse button on the Texture Bar.
- Double-click the
tools\toolsnodraw
material in the Texture Browser. - With your water brush selected, click the Apply Current Texture button to assign the
tool textures|tools\toolsnodraw
material to the whole brush. - Select the Texture Application tool, which opens the Face Edit mode.
- Left-Click the top face of the water brush in the 3D view to select it.
- Click Browse to bring up the Texture Browser again.
- Type
water
into the filter field. This will show you all materials with the keywordwater
in their name. - Select a water material to apply by double-clicking it. One water material to try is
nature/water_canals_water2
. - Click the Apply button on the Face Edit panel.
- The brush should have water correctly applied. Compile and run your map (with VVis and VRad enabled) to test it.

Cubemaps and water
Cubemaps are important to use with water surfaces. On lower than DX9 level video cards, it is not possible to render the real-time reflective water shader. For these cards, an env_cubemap entity provides the pre-calculated environment map use to render water on sub-DX9 cards.
Adding a env_cubemap to water surfaces:
- Add an env_cubemap entity using the Entity Tool.
- Place the env_cubemap above the top surface of the water, near the center.
- Double-click the env_cubemap in the 3D view to bring up the Object Properties dialog.
- Click on the Brush faces key in the Object Properties.
- Click the Pick... button. The mouse cursor will change to the eye dropper icon.
- Click the top water face to select it with the eyedropper. The face will highlight in red, to show it has been associated with the env_cubemap entity.
- Close the Object properties dialog.
- Compile and run your map. After the map is loaded, open the developers console and type
buildcubemaps
. The engine will calculate an environment map for each env_cubemap entity, and save the data into the BSP file.
Creating water materials
See Material Creation for general information on creating your own materials, and see Water Shader for specific information on how to create water materials.