Extracting CSGO water for use in another map [solved]
"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.
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:
"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".