Water (shader)
Jump to navigation
Jump to search

Note:If the above water material does not have reflections, refractions, or $underwateroverlay: $abovewater can be omitted, $nocull can be used, and $bottommaterial can be set to the same material as the abovewater material.


Water does not need to use the Water shader! If a less realistic effect is desired, or the water volume is oddly shaped, other shaders can be used, such as LightmappedGeneric or Refract. The method for creating the materials is the same. Liquids using using any shader other than Water will always be considered cheap.
Parameters
This is needed to make a map using the material compile properly.
Can be used instead of %CompileWater to get different particles. Planar reflections don't work with this, due to not applying SURF_WARP.
Whether this material is used for above or below the water’s surface.
Note:Not setting this in the VMT will automatically force it to 1. If not defined, a warning will appear saying

Need to set $abovewater for material x
Required parameter. This is the material (not texture) to use when underneath the water’s surface. The bottom material must have
Tip:Add %notooltexture to the bottom material to hide it in the texture browser (not in
).
$reflecttexture
, $abovewater
and $envmap
disabled, but can otherwise do whatever it wants. 


Applies a refracting screen overlay when the camera is underwater. Generally used with
Note:This is technically not a parameter on the water shader, meaning it can be abused for other unintended purposes! The overlay may still be applied even when the underwater material is told not to render ( $no_draw)
effects\water_warp01
. Requires $abovewater
to be 0.
Fog
Enable volumetric fog for the water. Note that the Water shader will always have fog regardless of this parameter, but $fogstart and $fogend will not work without it. Optional for all other shaders.
Color of the water’s volumetric fog. Generally this value should match the color used in the bottom material.
Important: If this parameter is not defined in a VMT, the shader will force its value to
Warning:
Tip:While expensive water cannot, cheap water can go higher than 1.0, achieving a more "neon" effect.

"[1 0 0]"
and spew an error message saying Material x needs to have a $fogcolor.

Cheap water treats this parameters as a linear value where 0.0 is 0% and 1.0 is 100%.
Expensive water treats this parameter as a Gamma value,
and due do this, each component ( red, green and blue respectively ) can not go above 1.0 or below 0.0 ( on expensive water )
x^(1/2.2)

Other
Tells the physics system that the surface is water. See $surfaceprop.
Defines the texture Hammer will display in the material browser. Any texture can be used, but it is customary to use the $normalmap.
WaterLOD proxy
- This connects the water_lod_control entity in a level to the water’s internal parameters. This must be declared in the material for the LOD mechanisms to work properly.