You’ve just played Bioshock… Wandering through the underwater streets of Rapture, you’re amazed by how effective the water shaders are that line the walls, creating a shimmering, warping effect that makes it seem like you’re under the sea… and now you want to know how to achieve that effect in Source. Good news. It’s possible, and here’s how.
Firstly, you’ll need two programs, which if you’ve been following this blog you’ll already have, but if you’ve arrived here via Google, download them below and follow the installation instructions given:
Boot up Photoshop, and create a blank canvas, 512 x 512 in size. Use the Cloud Filter with white and light blue (or any colours), and create a nice looking effect similar to below:
Now you’ll need to use the Offset Filter (described in the Tiling Textures tutorial) to make the texture tile perfectly for when we animate it later. Save this texture as underwater_glass.vtf using Nem’s VTF plugin and drop it into a “textures” directory in your materials folder of your mod. Now go to Filter; NVidia Tools; NormalMapFilter.
A window will appear, this is the NVidia Normal Map Filter plugin, and it allows you to create Normal maps for your textures. Use the following settings to create a second texture based on the first.
Once done, add a Gaussian Blur from Filter; Blur; Gaussian Blur.
Adjust it to look similar to this:
Save this file as “underwater_glass_normal.vtf” using Nem’s plugin and change Template in the window that opens to “Normal Map”.
Go back to your original file again, and open the NVidia Normal Map Filter again (Filter; NVidia; NormalMapFilter). This time we’re going to create a DuDv map, so use the settings below to create it:
The result should look like the image below:
Save this file as “underwater_glass_dudv.vtf” and change the Template setting to “DuDv”. Now you need to create a single VMT file using Notepad to control how the texture works. So open up Notepad and paste the following code inside, which includes fallbacks when using older versions of Direct X.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | "Refract" { "$model" "1" "$bluramount" "1" "$surfaceprop" "glass" "$refractamount" ".100" "$scale" "[1 1]" "$normalmap" "textures/underwater_glass_normal" "$dudvmap" "textures/underwater_glass_dudv" "$REFRACTTINTTEXTURE" "textures/underwater_glass" "Proxies" { "TextureScroll" { "texturescrollvar" "$bumptransform" "texturescrollrate" .1 "texturescrollangle" -90 } } "Refract_dx90" { "$refractamount" "0.100" } "Refract_DX80" { "$refractamount" ".025" "$REFRACTTINTTEXTURE" "textures/underwater_glass" "Proxies" { "TextureScroll" { "texturescrollvar" "$bumptransform" "texturescrollrate" 0.1 "texturescrollangle" -90 } } } "UnlitGeneric_dx8" { "$basetexture" "textures/underwater_glass" "Proxies" { "Sine" { "resultVar" "$alpha" "sineperiod" 15 "sinemin" 0.1 "sinemax" 0.1 } } "UnlitGeneric_dx6" { "$basetexture" "textures/underwater_glass" "Proxies" { "Sine" { "resultVar" "$alpha" "sineperiod" 15 "sinemin" 0.1 "sinemax" 0.1 } } } } } |
Save the file as “underwater_texture.vmt” and include the quotation marks to ensure it saves as a VMT file and not a TXT file. Now just load up Hammer, and place your texture where you want it! Once you’re happy, compile your map and check it out in game! If all has gone well, it should look like this, only better as it’s actually moving and refracting the objects behind it!
Now you’ve just got to promise me you didn’t steal the images directly from this tutorial and use them! It’s far more fun to do it yourself!








May 2nd, 2009 at 4:01 pm
If you don’t have Photoshop, there’s always Normal maps in GIMP.
May 2nd, 2009 at 4:38 pm
There are? Like, in built into GIMP?
May 2nd, 2009 at 7:54 pm
Yup, it’s built in. Filters -> Map -> Bump Map.
CrazyBump is pretty good too.
July 23rd, 2009 at 1:51 pm
hello Wills
Can you upload the final file on, example file-front ?
i really can’t find out making this. xD
July 24th, 2009 at 12:17 pm
—>And maby post the link
July 24th, 2009 at 10:22 pm
Should the texture appear as a black and purple checkerboard?
July 25th, 2009 at 12:26 pm
I’ll upload the final result later today for you guys. And to Vidster, no it shouldn’t. Check your VMT file for spelling errors and any context mistakes.
July 25th, 2009 at 3:15 pm
THANKS!
July 27th, 2009 at 1:02 am
http://www.jailbreaksource.com/betafiles/bioshock_glass.zip
Make sure to either change the names or locations within the VMT files, or just stick them inside materials/jb_textures to make them work!
July 28th, 2009 at 1:58 pm
Not that it has to much to do with the subject
but, if you want to see what i have been doing latly
here is a link:
http://forums.tf2maps.net/showthread.php?t=7199
July 28th, 2009 at 2:00 pm
“lately” sorry
February 28th, 2010 at 4:14 pm
Hey, any chance of uploading the files again please?
I tried it myself but there must be an error somewhere in my vmt somewhere but for the love of things I can’t find it and I keep getting the purple and black checkers
February 28th, 2010 at 4:18 pm
Actually wait, its okay I managed to get it to work
Cheers for tutorial anyway