Please or Register to create posts and topics.

Extracting CSGO water for use in another map [solved]

I want to use the CSGO water texture "shack_water" in a map for Portal 2. So I've located the .vmt in CSGO's pak01_dir.vpk. But the .vmt requires some other materials that I don't know where to find, that I also need to extract for the texture to be usable. Inside shack_water.vmt:

"Water"
{
"%compilewater" 1
"%tooltexture" "dev/water_normal"

//forceexpensive Must be set to 1 for Portal 2 water reflections to work.
$forceexpensive 1
"$abovewater" 1
"$surfaceprop" "water"
"$bottommaterial" "dev/dev_waterbeneath2"
"$normalmap" "dev/water_normal"

So I need the files "dev/water_normal", "water", and "dev/dev_waterbeneath2", but I'm not sure where to find them in CSGO.

$surfaceprop "water" is just a name, not a texture, and "dev/water_normal" is already in the Portal 2 library. So you don't need to worry about those.

The only missing one is "dev/dev_waterbeneath2". That is the material for the bottom side of the water surface and it's in the HL2 library.

I did a quick test and it appears that Portal 2 does not include the HL2 textures, so you need to include this material with your map. Here it is:

Code: Select all
"Water"
{
   "Water_DX60"
   {
      "$fallbackmaterial" "nature/water_dx70_beneath"
   }
   "$abovewater" 0
   "%compilewater" 1
//   "$forcecheap" 1
   "$CHEAPWATERSTARTDISTANCE" 500.0
   "$CHEAPWATERENDDISTANCE" 1000.0
   // bottom materials shouldn't use $envmap!!!  They won't work if they do.
//   "$envmap" "env_cubemap"
   "%tooltexture" "dev/water_normal"
   "$refractamount" "1.0"
   //"$refracttint" "[0.95 1.0 0.97]"

   "$reflectamount" "1.0"
   //"$reflecttint" "[1 1 1]"

//   "$reflecttexture" "_rt_WaterReflection"
   "$refracttexture" "_rt_WaterRefraction"

   "$scale" "[1 1]"

   "$bumpmap" "dev/water_dudv"
   "$normalmap" "dev/water_normal"

   "$surfaceprop" "water"
   "$bumpframe" "0"

   "$fogenable" 1
   "$fogcolor" "{22 20 10}"
   "$fogstart" 1.00
   "$fogend" 400.00

   "Proxies"
   {
      "AnimatedTexture"
      {
         "animatedtexturevar" "$normalmap"
         "animatedtextureframenumvar" "$bumpframe"
         "animatedtextureframerate" 30.00
      }

      "TextureScroll"
      {
         "texturescrollvar" "$bumptransform"
         "texturescrollrate" .05
         "texturescrollangle" 45.00
      }

      "WaterLOD"
      {
      }
   }
}

It looks like the other textures in this material are also included with Portal 2. I could not test it completely, since the text snippet you pasted is probably not the entire material script, but I could get the underwater side to look correctly using this bottom material.

So the only thing you need to do is paste the above text into a new VMT and refer to that VMT instead of "dev/dev_waterbeneath2".

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic