How to make a water transparent ?

So here is what I got:

Under water everything seems ok and I like it.
But from top of water I want to be able to see what’s under it, and players swiming in it, and especially want to see lighting through it. How do I edit vmt file?


"Water"
{

    "$abovewater" 1
    "%compilewater" 1
    "$forceexpensive" 1
    "$reflectentities" 0
    "$envmap" "env_cubemap"
    "%tooltexture" "nature/water_frame01_normal"
    "$refracttexture" "_rt_WaterRefraction"
    "$refractamount" "5"


    "$reflecttexture" "_rt_WaterReflection"
    "$reflectamount" "1"

    "$scale" "[1 1]"

    "$bumpmap" "water/water_epic_DUDV"
    "$normalmap" "water/water_epic_normal"

    "$surfaceprop" "water"
    "$bottommaterial" "water/Clear_beneath"
    "$bumpframe" "0"

    "$fogenable" 1
    "$fogcolor" "{0 45 50 }"
    "$fogstart" 5000
    "$fogend" 5000

    "$scroll1" "[.0001 .01 .01]"
    "$scroll2" "[-.01 .01.01]"

    "Proxies"
    {
        "TextureScroll"
        {
            "texturescrollvar" "$bumptransform"
            "texturescrollrate" .00001
            "texturescrollangle" 70.00
        }
        "WaterLOD"
        {
        }
            
    }

}

You might want to ask this in the mapping subforum, they know more about this type of question.

If you’re not already, use VTFEdit to edit the VMT.

I had a quick google around and a search on interlopers but couldn’t find anything specific on water transparency. Have a quick read of these links over on the Valve dev wiki and see if they are of any use;

It might be something to do with your material/brush choice or just missing a parameter from the VMT file. Maybe looking up a list of parameters that can be included within the VMT would be another place to look.

Something in all of this must make this water texture transparent as it is in this map: http://www.nodraw.net/2010/01/dynamic-materials-with-proxies/

VMT is for a lappping wave on a beach.


"LightmappedGeneric"
{
    "$basetexture" "proxy_museum/foam"
    "$additive" "1"

    "$minus_one" -1.0
    "$zero" 0
    "$half" 0.5
    "$quarter" 0.25
    "$one" 1
    "$two" 2
    
    // Variables
    "$s" 0.0
    "$ds" 0.0
    "$sx" 0.0
    "$s_plus_1" 0.0
    "$s_minus_1" 0.0
    "$ds_plus_2" 0.0
    "$abs_sx" 0.0
    "$s_is_positive" 0
    "$s_is_negative" 0
    "$ds_is_positive" 0
    "$ds_is_negative" 0
    "$translate" "[0 0]"

    // Intermediate values
    "$x_tmp1" 0.0
    "$x_tmp2" 0.0
    "$x_tmp3" 0.0
    "$x_tmp4" 0.0
    "$a_tmp1" 0.0
    "$a_tmp2" 0.0
    "$a_tmp3" 0.0
    "$a_tmp4" 0.0

    "Proxies"
    {
        // The sine wave and its derivative
        "Sine"
        {
            "sinemin" -1
            "sinemax" 1
            "sineperiod" 8.0
            "resultVar" "$s"
        }
        "Sine"
        {
            "sinemin" -1
            "sinemax" 1
            "sineperiod" 8.0
            "resultVar" "$ds"
            "timeoffset" 6.0
        }
        "Sine"
        {
            "sinemin" -1
            "sinemax" 1
            "sineperiod" 16.0
            "resultVar" "$sx"
            "timeoffset" 2.0
        }

        
        // Derive s+1, s-1, s+2, abs_sx
        "Add"
        {
            "srcVar1" "$s"
            "srcVar2" "$one"
            "resultVar" "$s_plus_1"
        }
        "Subtract"
        {
            "srcVar1" "$s"
            "srcVar2" "$one"
            "resultVar" "$s_minus_1"
        }
        "Add"
        {
            "srcVar1" "$ds"
            "srcVar2" "$two"
            "resultVar" "$ds_plus_2"
        }
        "Abs"
        {
            "srcVar1" "$sx"
            "resultVar" "$abs_sx"
        }


        // Derive variables for positive and negative quadrants
        "LessOrEqual"
        {
            "LessEqualVar" "$zero"
            "greaterVar" "$one"
            "srcVar1" "$s"
            "srcVar2" "$zero"
            "resultVar" "$s_is_positive"            
        }
        "Subtract"
        {
            "srcVar1" "$one"
            "srcVar2" "$s_is_positive"
            "resultVar" "$s_is_negative"
        }
        "LessOrEqual"
        {
            "LessEqualVar" "$zero"
            "greaterVar" "$one"
            "srcVar1" "$ds"
            "srcVar2" "$zero"
            "resultVar" "$ds_is_positive"            
        }
        "Subtract"
        {
            "srcVar1" "$one"
            "srcVar2" "$ds_is_positive"
            "resultVar" "$ds_is_negative"
        }

        // Y is (1/4)(S - 1)
        "Multiply"
        {
            "srcVar1" "$quarter"
            "srcVar2" "$s_minus_1"
            "resultVar" "$translate[1]"
        }        

        // X is (1/2)(ds_is_negative * abs_sx + (ds_is_positive * (1 - abs_sx))
        "Multiply"
        {
            "srcVar1" "$ds_is_negative"
            "srcVar2" "$abs_sx"
            "resultVar" "$x_tmp1"
        }
        "Subtract"
        {
            "srcVar1" "$two"
            "srcVar2" "$abs_sx"
            "resultVar" "$x_tmp2"
        }
        "Multiply"
        {
            "srcVar1" "$ds_is_positive"
            "srcVar2" "$x_tmp2"
            "resultVar" "$x_tmp3"
        }
        "Add"
        {
            "srcVar1" "$x_tmp1"
            "srcVar2" "$x_tmp3"
            "resultVar" "$x_tmp4"
        }
        "Multiply"
        {
            "srcVar1" "$x_tmp4"
            "srcVar2" "$half"
            "resultVar" "$translate[0]"
        }
        
        "TextureTransform"
        {
            "translateVar" "$translate"
            "centerVar" "$center"
            "rotateVar" "$rotate"
            "resultVar" "$basetexturetransform"
        }

        // Alpha is (ds_is_negative * clamp(s to 0,1)) + (ds_is_positive * 1/2 * s_plus_1)
        "Clamp"
        {
            "min" "0"
            "max" "1"
            "srcVar1" "$s"
            "resultVar" "$a_tmp1"
        }
        "Multiply"
        {
            "srcVar1" "$a_tmp1"
            "srcVar2" "$ds_is_negative"
            "resultVar" "$a_tmp2"
        }
        "Multiply"
        {
            "srcVar1" "$s_plus_1"
            "srcVar2" "$half"
            "resultVar" "$a_tmp3"
        }
        "Multiply"
        {
            "srcVar1" "$a_tmp3"
            "srcVar2" "$ds_is_positive"
            "resultVar" "$a_tmp4"
        }
        "Add"
        {
            "srcVar1" "$a_tmp2"
            "srcVar2" "$a_tmp4"
            "resultVar" "$alpha"
        }
    }
}

I also found this in the Source Materials.GCF on the water_canals_water2.vmt:


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

	"$abovewater" 1

	"$envmap" "env_cubemap"
	"$refracttexture" "_rt_WaterRefraction"
	"$refracttint" "{255 250 245}"

	"$reflectamount" ".3"
	"$reflecttint" "[1 1 1]"

	"$cheapwaterstartdistance" "2000"
	"$cheapwaterenddistance" "3000"

	"Water_DX90"
	{
		// Only used in dx90 and higher
		// ALSO NOTE: This *cannot* exist in the root level, because the presence of this 
		// is used to determine whether to do the reflection in the client DLL
		"$reflecttexture" "_rt_WaterReflection"
		"$refractamount" "2.1"
	}

	"Water_DX81"
	{
		"$refractamount" ".6"
		"$reflecttint" "[0.5 0.5 0.5]"
		"$fogend" 200.00
	}

	"Water_DX80"
	{
		"$refractamount" ".6"
		"$reflecttint" "[0.5 0.5 0.5]"
		"$fogend" 200.00
	}

	"Water_DX60"
	{
		"$fallbackmaterial" "nature/water_canals_water2_dx70"
	}

	"$scale" "[1 1]"

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

	"$surfaceprop" "water"
	"$bottommaterial" "nature/water_canals_waterbeneath2"
	"$bumpframe" "0"

	"$fogenable" 1
	"$fogcolor" "{52 49 44}"
	"$fogstart" 1.00
	"$fogend" 300.00

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

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

		"WaterLOD"
		{
		}
	}
}

Must be something in them as they are both transparent.

Pm Firegod, and check out his texture thread.