[Next - Step 2: POVray]

Step 1: Creating a Cube Map

The first thing you need to do before making an Anachronox environment map is to create a cube map. A cube map is a neat way to represent a 360° view of an environment by using only six textures, fitting together as a cube. Below is an image showing how six images of a cube map fit together.

Reference Cube Map
Reference Cube Map Image

The names up, dn, and so forth correspond with the names of the sky textures used in Anachronox (which are themselves cube environment maps) which can be found in /anoxdata/graphics/sky/. The numbers represent the naming scheme that must be used for the textures before feeding them into POVray (that is a later step in our process). Here is a sample view from inside the cube, so you can get an idea of how the sides fit together:

Cube Interior
Cube Interior Image

I put underlines on the top and bottom labels so the orientation isn't confused (if you write "up" upside-down you get "dn"). This cube map was generated from inside an actual Anachronox level, specifically, the computer room in map hive. If you go into this room in Anachronox, you should see the reflective entity that is using the Anachronox environment map generated from this cube map.

Generating Cube Maps with 3D Programs

Any 3D rendering package, just as Lightwave, Maya, or Bryce3D, can be used to create complex and beautiful environment maps. You can use these paint programs to generate cube maps by rendering your scene six times at right angles, making sure that the horizontal and vertical FOV are both exactly 90°. You should consult the documentation for your paint program to learn how to do this.

Generating Cube Maps with Anachronox

The process is relatively straightforward and more useful for generating contextual environment maps than using an external 3D program. First, find a computer where you can run Anachronox at 1280x960 or higher. The environment map will look much nicer than if you do this method running only at 640x480. Once Anox is running, execute the following commands:

exec q2.cfg
forcecursormode 1
r_novis 1
r_nocull 1
debug 0
bind p "paused 666"
bind o "paused 0"
bind f12 "r_envshot 1"

You can bind the commands to anything, I just used these keys because they are convenient for my config. Here is an explanation of what these commands do:

So, run around until you find the place where you will want to place your reflective entity. If you are going to put several entities in the same area, you can just find some pretty spot in the middle to generate your environmental screenshots instead of making several separate ones; this saves texture memory and people can't really tell the difference.

After you've found a pretty spot, press <P> to pause the game, then press <F12>. The direction you are facing doesn't matter, just your position. The view becomes squished-looking and the camera should spin around, taking six screenshots as it goes. The view distortion is caused by the camera forcing the vertial FOV and the horizontal FOV to BOTH be exactly 90°; usually, the ratio of the vertial and horizontal FOV matches your screen aspect ratio. Once it is finished, bring down the console and write down the screenshot filenames that it generated. Order matters. You may have ended up with something like this in the console:

Wrote v:\anachronox/anoxdata/screenshots/nox00195.tga
Wrote v:\anachronox/anoxdata/screenshots/nox00196.tga
Wrote v:\anachronox/anoxdata/screenshots/nox00197.tga
Wrote v:\anachronox/anoxdata/screenshots/nox00198.tga
Wrote v:\anachronox/anoxdata/screenshots/nox00199.tga
Wrote v:\anachronox/anoxdata/screenshots/nox00200.tga

That's it! Now you have the six images needed for a cube environment map. First, rename the files as follows:

ren nox00195.tga env1.tga
ren nox00196.tga env2.tga
ren nox00197.tga env3.tga
ren nox00198.tga env4.tga
ren nox00199.tga env5.tga
ren nox00200.tga env6.tga

3D Screenshot Viewer

You can distribute these six files and have other people be able to view your cool 3D Anachronox screenshot. Resize all six images to 512x512 using your favorite paint program, save them in color JPEG format, and then enview, the Anachronox 3D screenshot viewer, can display them.

Anachronox Sky Box

You can use these six textures as a sky box in an Anachronox level. Resize all six images to 256x256 using your favorite paint program, save them in 24-bit TGA format, and then rename using the sky-box naming scheme. For example, if you want to create the Anachronox sky box named "skuld" you should do the following (using our examples files):

ren env1.tga skuldrt.tga
ren env2.tga skuldbk.tga
ren env3.tga skuldlf.tga
ren env4.tga skuldft.tga
ren env5.tga skulddn.tga
ren env6.tga skuldup.tga

If you forget what order "rt", "bk", etc. should be in, just reference the image near the top of this page.

Parabolic Environment Mapping

This is the whole reason you're reading this doc, anyways, right? Okay, let's go on...

[Next - Step 2: POVray]