Well, you have to do some scripting within your water .vmt file. I forgot to link this as well:
https://developer.valvesoftware.com/wiki/Material_proxies
Since fog is using three values as a rgb, you need to set up accordingly. First, you should setup three variables for each of the rgb values. You can create custom variables in .vmt files that can be used by proxies. Something like this:
Code:
"$fogr" "0"
"$fogg" "0"
"$fogb" "0"
On their own, these variables doesn't do anything, but you can write to and read from them at runtime.
Proxies have to be created within the
"Proxies" block of your vmt file. You'll have to use an individual proxy for each of your rgb values. For instance, if you want the red value of the fog pulse between 0.0 and 1.0, you should add a
Sine proxy. A
Sine proxy will cuase the affected variable to constantly oscillate. It should look something like this.
Code:
"Proxies"
{
"Sine"
{
"resultVar" "$fogr" // This would be the custom variable for the specific fog rgb value you want to change.
"sineperiod" "5" // How fast you want the value to pulse
"sinemin" "0.0" // Set the min and max values to the min and max values you want your colors to be.
"sinemax" " 1.0"
}
}
This will cuase the
$fogr value to oscillate between 0.0 (no red) to 1.0 (full red).
Now, you need to read from these variables and add them to your
$fogcolor variable, which is what the game actually uses to render the water color. This is accomplished through the
Equals proxy. What this does is simply copy the value of one variable, and paste it into another. Additionally, it can also specify
where it should put your value, if there are multiple values, like in
$fogcolor. You should setup an
Equals proxy for each of your rgb values like this:
Code:
"Equals"
{
"srcVar1" "$fogr" // The name of the variable you want to copy
"resultVar" "$fogcolor[0]" // The last number indicates where you want to insert the variable. 0 is for red, 1 is for green, and 2 is for blue.
}
And that
should be it. I haven't actually tested it, but theoreticly, it should work.