Making a wall of water

From Valve Developer Community
Revision as of 10:05, 21 March 2009 by SpAnser (talk | contribs) (New page: thumb|Water with a shader"LightmappedGeneric". == Principe == In some cases, create a wall of water is a solution. However, the shader "water" can not do that, it i...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Water with a shader"LightmappedGeneric".

Principe

In some cases, create a wall of water is a solution. However, the shader "water" can not do that, it is limited to a flat surface, not vertically. It uses current shader here: "LightmappedGeneric" with shader settings to "water" to remedy the problem.

You can simulate the reflections with cubemaps, fog, only with the materials "bottom", but no refractions. Like the water shader you have to use 2 VMT. BUMP will be used the one supplied by Vavle and materials used by the "water".

VMT top

For texture "$ basetexture", an image created in Photoshop with a cloud filter should make an alpha channel using the desired transparency. You can then export to a file. VTF used under Source with the right tools.

"$basetexture" generated under Photoshop.


"LightmappedGeneric"
{
         "%compilewater" 1
         "$abovewater" 1
         "$surfaceprop" "water"
         "$bottommaterial" "..."
         "$basetexture" "dev/water_moving"  / / base texture that you made earlier
         "$bumpmap" "dev/water_normal"      //bump map
         "$translucent" "1"                 
         "$envmap" "env_cubemap"
         "$envmaptint" "[1 .9 .8]"
         "$envmapcontrast" "1"
         "$fogenable" "1"                
         "$fogcolor" "[ 1 1 1 ]"      
         "$fogstart" 0                    
         "$fogend" 50                
"Proxies"
{
    "AnimatedTexture"
          {
               "animatedtexturevar" "$basetexture"
               "animatedtextureframenumvar" "$frame"
               "animatedtextureframerate" 21.00
          }
    "AnimatedTexture"
          {
               "animatedtexturevar" "$bumpmap"
               "animatedtextureframenumvar" "$bumpframe"
               "animatedtextureframerate" 21.00
          }
}
}

You will notice here that the basic texture is animated when he is just an image. This is necessary for the BumpMap animated.

VMT Bottom

"LightmappedGeneric"
{
          "$basetexture" "..."
          "$translucent" "1"
          "$fogenable" "1"                 
          "$fogcolor" "[ 1 1 1 ]"      
          "$fogstart" 0                    
          "$fogend" 300                
}

References

Was translated from the French page http://developer.valvesoftware.com/wiki/Making_a_wall_of_water:fr