Moving Water:ru

From Valve Developer Community
Revision as of 18:34, 29 August 2008 by 00000 (talk | contribs)

Jump to: navigation, search
See also: Flowing Water
Поднимающаяся вода на карте cs_militia.
Движок Source поддерживает воду как ентити func_water_analog, которая может передвигаться так же, как и func_movelinear .

Ограничения

Хотя перемещение воды в принципе возможно, есть некоторые ограничения.

  • Не используется шейдер воды. Для воды используется bump mapping (чтобы "удешевить" воду, т.е. сделать менее ресурсоёмкой).
  • Перемещение воды не всегда корректно реагирует как нормальная вода. Ентити клиента, например, осколки от объектов в HL2MP или рэгдоллы,не всплывают.
  • Всплески (чаще всего видны при взрывах) неправильно визуализируются. Скорее всего, они будут появляться на начальном уровне воды, чем на конечном,.
  • Под водой не происходит изменения вида, и вода выглядит "ярче", чем нормальная.

Создание

To add a moving water volume to your level, follow these steps:

Creating the Water Brush

Step 1
  1. Create a brush the size of the water volume using the Block Tool.
  2. Open the Texture Browser by clicking the Browse button on the Texture Bar.
  3. Double-click the tools\toolsnodraw material in the Texture Browser.
  4. With your water brush selected, click the Apply Current Texture button to assign the tools\toolsnodraw material to the whole brush.
  5. Select the Texture Application tool, which opens the Face Edit mode.
  6. Left-Click the top face of the water brush in the 3D view to select it.
  7. Click Browse to bring up the Texture Browser again.
  8. Type movingplane into the filter field and select the texture nature/water_movingplane.
  9. Click the Apply button on the Face Edit panel.

Configuring the func_water_analog entity

Step 2
  1. Now you have constructed the water brush, press Ctrl + T to tie the brush to an entity. Select func_water_analog from the list.
  2. In order to trigger your water, you must name it. Enter an identifier for the water in the Name field.
  3. Select the direction for the water to move in the Move Direction field. For most cases, you should select Up from the list.
  4. Enter a speed at which your water should move. 55 works well, but the speed should depend on the situation.
  5. The entity uses the Move Distance field to determine how far the water should move. If you enter the height of your water brush, it will move fully above its starting position (the bottom of the brush will be where the top of the brush was originally).
  6. You can select sounds to be played when the water starts or stops moving with the Sounds played... fields.

Triggering the Water

The func_water_analog entity can be moved via two inputs, Open and Close. See Inputs & Outputs for more information.

Cubemaps and Moving Water

As mentioned earlier, moving water cannot use the water shader and instead has the same visual properties as "cheap" water, using a pre-calculated environment map from an env_cubemap instead.

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:

  1. Add an env_cubemap entity using the Entity Tool.
  2. Place the env_cubemap above the top surface of the water, near the center.
  3. Double-click the env_cubemap in the 3D view to bring up the Object Properties dialog.
  4. Click on the Brush faces key in the Object Properties.
  5. Click the Pick... button. The mouse cursor will change to the eye dropper icon.
  6. 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.
  7. Close the Object properties dialog.
  8. 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.