[Back to Intro]

Tips for Successful Environment Map Generation

Environment maps don't necessarily need to come from Anachronox environments. If you want to create your own environment map, some of these ramblings may come in handy.

As you know, the parabolic environment map method uses two sources textures. It draws the entity in two passes, first with the front environment map, and then with the back environment map with a special alpha channel applied to it. The images below are a sample environment map, showing the alpha channel that Anachronox uses for the back image.

front back
Front Texture Back Texture with alpha

Because it draws in two passes, and because we are only using per-vertex, not per-pixel, parabolic environment mapping, there is a seam visible around the circle of the back image. To better illustrate the seam, here are two example screenshots:

normal
Normal Reflection

And here is the same image with the back image colored green:

seam-enhanced
Enhanced-seam Reflection

As you can see, there is a seam that occurs along the edge of the circle of the alpha map of the back image (the seam also occurs in the same place in the front image), and it makes the horizon in our example look disjointed. Most of the time, this seam is not noticeable, especially on animating or rotating entities, but occasionally it can be a problem, especially on sharp and higher-resolution environment maps. An easy workaround is to use lower resolution environment maps and/or blur the image. However, it is the responsibility of the environment map artist to try and make sure that very sharp contrast elements do not occur across the seam, such as the sunlit horizon in this example. So far, we've been using an environment cube I generated from map tensil, here is the cube map laid out:

Tensil Cube Map Layout
Tensil Cube Map

And here is a visualization of how the seam results from dual parabolic mapping (click on the image to view the movie):

Parabolic Seam Visualization
Parabolic Seam Visualization

The x axis is red, the y axis is green, the z axis is blue, and the pink dividing square shows the plane along which the seam occurs. When you are creating environment maps from scratch, it is best to avoid details that cross the seam which is along the Y-Z plane as shown above. One technique is to rotate the base camera position for the cube map generation in your 3D package.

Unfortunately, this technique cannot apply to screenshots taken within Anachronox. When Anachronox takes a set of cube-environment screenshots, it will always position the 6 textures in the manner shown above. The first image is out on the positive x axis, the second image is on the positive y axis, and so forth. Initial camera rotation has no bearing on the output, only camera position. The workarounds including trying to position the camera for the screenshots to minimize the seam problem, or to heavily blur and use lower resolution textures so details are not apparent along the seam.

Please send any comments, suggestions, or more tips to Joey.

[Back to Intro]