
This tutorial assumes you know how to import textures and create fluid surfaces.
| An environment map is a kind of 3d snapshot of part of your level. It's used to make water and other surfaces look reflective. This tutorial will show you how to make a reflective fluid surface from scratch. First you need to make a CubeMap, this contains 6 screenshots of a point in the level from different angles. You can then make an Environment Map (TexEnvMap) and Shader to use on the fluid surface. |
|

Diagram showing the 6 environment map textures
To take the screenshots accurately from six different angles, you need to make some keybinds in the user.ini file. Go to the UT2004\System Folder and open User.ini in a text editor (it's a good idea to make a backup first). Search for the text "NumPad" and replace NumPad keys 0-6 with the following:
NumPad0=set playercontroller bZeroRoll False | set playercontroller rotation (pitch=0,yaw=0,roll=16384)
NumPad1=set playercontroller bZeroRoll False | set playercontroller rotation (pitch=0,yaw=32768,roll=-16384)
NumPad2=set playercontroller bZeroRoll False | set playercontroller rotation (pitch=0,yaw=16384,roll=32768)
NumPad3=set playercontroller bZeroRoll False | set playercontroller rotation (pitch=0,yaw=-16384,roll=0)
NumPad4=set playercontroller bZeroRoll False | set playercontroller rotation (pitch=16384,yaw=0,roll=16384)
NumPad5=set playercontroller bZeroRoll False | set playercontroller rotation (pitch=-16384,yaw=0,roll=16384)
NumPad6=set playercontroller bZeroRoll True | set playercontroller rotation (pitch=0,yaw=0,roll=0)
Search the rest of the file for "NumPad" and delete any duplicate entries you find. This is to make sure the new keybinds work properly. Numpad keys 0-5 rotate the camera view to each angle for the CubeMap, and Numpad 6 returns the camera to normal.
When you're ready to take the screenshots, start your map and set up the view by doing the following:
To take the screenshots, press each Numpad key in turn (0-5) followed by F9 to take a screenshot. If your scene includes emitters or other animating effects it's a good idea to pause the game first. You should now have six 256x256 .bmp files saved to the UT2004\Screenshots folder. If you rename them, make sure the filenames reflect the order in which they were taken (e.g. cube0, cube1, cube2 etc.)
With Paint Shop Pro, Photoshop, or another image editing program you can touch up the screenshots or add effects. If you apply an effect to one image, apply the same effect to all the images otherwise you might see the edges of the texture in the envmap. Here are a few ideas:
Gaussian Blur
Gives the screenshots a softer look, good for fluid surfaces. A blur radius of 1.2 or below looks best.

PSP7: Effects > Blur > Gaussian Blur
Photoshop: Filter > Blur > Gaussian Blur
Brightness/Contrast/Colour
You could lighten the image if it's too dark, give it more contrast or a coloured tint for water. I've adjusted the brightness and colorized the image below with a blue tint.

PSP7: Options under the Colours > Adjust menu.
Photoshop: Options under the Image > Adjust menu.
Retouch Tools
The retouch tools allow you to add some special effects to the screenshots, like making windows look like they glow. The dodge tool has been used on the windows below (it probably looks better on screenshots where the window has a very dark surrounding).
Dodge: Brightens an area of the image and makes it look like it glows.
Burn: The opposite of dodge - darkens an area of the image.
Blur (Soften in PSP7): Blurs an area of the image.
Lightness Up/Down (PSP7): Lightens an area of the image, effect isn't as strong as dodge.

PSP7: Click the retouch icon on the left and select the tool type in the tool options window.
Photoshop: Right-click one of the icons in the toolbar on the left, and select a tool type from the menu.
Making a CubeMap
Making a TexEnvMap
You can apply the TexEnvMap to the fluid surface on it's own, but it isn't transparent and looks a bit like mercury, not water. There are some more advanced shader effects than this, but here's how to create a simple realistic-looking transparent water shader. By now you should have a working Environment Map, and you also need to find a water texture with an alpha channel (for transparency). I've imported my own here, there are plenty in the default packages too. You could look at water shaders from existing maps to see how they're set up.

If you want the water texture to show up as well as the envmap, set the water texture as "diffuse". It depends on the textures whether or not it looks better or worse.

Apply the shader to a fluid surface and you're done! Enjoy!
