muddy water shader
Posted: Thu Jul 18, 2002 12:29 am
I figured out how to make a water shader!!! I used the canal_sludge texture lines from the misc_outdoors shader to start with. Turns out there is a missing TGA file for that one and that's why it comes out clear looking. Anyway, I copied the ocean2_green.jpg from textures/misc_outdoors and changed the colors and name. Then I made the same jpg into a TGA with the alpha channel from ocean2.tga. It was not easy getting the colors right and at different points I ended up with orangejuice, lemonaid, and green coolaid, ha ha. But, I did finally get it as you can see below.

below is the script for it, but you'll have to make your own image files.
textures/w/brown_water
{
qer_editorimage textures/w/ocean2_brown.tga // Image seen in editor texture window.
qer_keyword natural // These make the texture pop up
qer_keyword liquid // in the editor when you
qer_keyword ocean // type in the keyword.
qer_keyword water // I added this one.
qer_trans .4
surfaceparm trans
surfaceparm water
surfaceparm nolightmap
cull none
deformvertexes wave 2 sin 1 3 0 .2 // make the surface move up and down.
{
map textures/w/brown_water.jpg // This is the bottom layer.
depthWrite
rgbGen identity
tcMod bulge -1.5 .02 .1 .5
tcMod scroll -0.04 -0.04 // Makes the surface move sideways at the speeds set.
}
{
map textures/w/ocean2_brown.tga // This is the top layer.
depthwrite
blendfunc add
tcMod scroll 0.03 0.03
nextbundle
map textures/w/ocean2_brown.tga
tcMod scroll -0.02 -0.02
}
}
That's all, just save it as yourwater.shader in the scripts folder and put your texture images in a folder called "w" or whatever.
Good luck!

below is the script for it, but you'll have to make your own image files.
textures/w/brown_water
{
qer_editorimage textures/w/ocean2_brown.tga // Image seen in editor texture window.
qer_keyword natural // These make the texture pop up
qer_keyword liquid // in the editor when you
qer_keyword ocean // type in the keyword.
qer_keyword water // I added this one.
qer_trans .4
surfaceparm trans
surfaceparm water
surfaceparm nolightmap
cull none
deformvertexes wave 2 sin 1 3 0 .2 // make the surface move up and down.
{
map textures/w/brown_water.jpg // This is the bottom layer.
depthWrite
rgbGen identity
tcMod bulge -1.5 .02 .1 .5
tcMod scroll -0.04 -0.04 // Makes the surface move sideways at the speeds set.
}
{
map textures/w/ocean2_brown.tga // This is the top layer.
depthwrite
blendfunc add
tcMod scroll 0.03 0.03
nextbundle
map textures/w/ocean2_brown.tga
tcMod scroll -0.02 -0.02
}
}
That's all, just save it as yourwater.shader in the scripts folder and put your texture images in a folder called "w" or whatever.
Good luck!