Replacement Texture Guide
From AlephWiki
Contents |
Recommendations
- Avoid PNG and JPEG -- Use Aorta to create DDS textures
- Combine the image and mask into the same DDS file
- Use DXTC when possible
- DXTC may not work well for landscapes or certain textures
- It's OK to mix DXTC textures with non DXTC textures
- Always enable mipmaps except for:
- Weapons in hand images that are not wider or higher than 256 pixels
- Interface collection replacements
- Enable halo removal unless the source image already has the transparent areas filled in
- Make sure to include a type attribute in each <texture> element
- Walls are type="0"
- Landscapes are type="1"
- Inhabitants (aliens, bobs, items) are type="2"
- Weapons-in-hand are type="3"
- See the MML guide for more info on writing replacement texture MML
Formats
Aleph One supports these formats:
- BMP
- basic uncompressed image format
- JPEG
- Joint Photographers Exchange Group format, a lossy format typically used for storing photos
- PNG
- Portable Network Graphic, a lossless compressed format typically used for web graphics
- DDS (RGBA)
- DirectDraw Surface file containing uncompressed image data and mipmaps
- DDS (S3TC)
- DirectDraw Surface file containing S3TC lossy compressed image data and mipmaps
Comparison
| Format | Size on Disk | Size in Zip | RAM Usage | VRAM Usage | Load Speed | Image Quality | Supports Separate Mask | Supports Combined Mask | Supports Mipmaps |
|---|---|---|---|---|---|---|---|---|---|
| BMP | Large | Medium | High | High | Fast | High | Yes | Yes | No |
| JPEG | Small | Small | High | High | Very Slow | Medium | Yes | No | No |
| PNG | Medium | Medium | High | High | Slow | High | Yes | Yes | No |
| DDS (RGBA) | Large | Medium | High | High | Fast | High | No | Yes | Yes |
| DDS (S3TC) | Medium | Small | Medium | Medium | Fast | Medium | No | Yes | Yes |
DDS tools
You can find some (Windows-only) tools to create DDS textures here: http://developer.nvidia.com/object/dds_utilities.html
Texture Size
Because of the restrictions of OpenGL versions earlier than 2.0 (which is mostly what Aleph One has to use), all textures have to be powers-of-two sizes in order to be loaded (for example, 64, 128, 256, 512, 1024, 2048 pixels in height or width). For this reason, if Aleph One loads a file that has dimensions that are not powers-of-two, it has to resize the image to powers-of-two before it loads, which wastes memory. It makes sense to design textures that are powers-of-two sized to start with, so you get the most out of the RAM/video memory you're using.
DXTC textures are compressed using blocks of 4x4 pixels. So, you need to resize your texture so the height and width are both multiples of four before compressing. You don't need to worry about aspect ratio; Aleph One will use the aspect ratio in the shapes file, as long as you scale your texture (don't use Photoshop's Canvas... command).
Masks
Aleph One doesn't support combining separate images and masks for DDS textures, like it does with JPEG. Combine the image and the mask by putting the mask in the alpha channel, and exporting to a format that supports an alpha channel such as BMP or TIFF, before converting to DDS.
Mipmaps
Mipmaps are a series of progressively images that are used to smooth distant textures, as well as reducing the load on video cards for rendering distant textures. DDS files support storing mipmaps in them, which saves Aleph One the trouble of creating them in real time. Also, by choosing smaller mipmaps to start loading, Aleph One can reduce its video memory requirements in exchange for smaller textures.
I recommend using mipmaps for all wall textures (since Aleph One uses mipmaps for walls normally). If you are not using *any* shapes file sprite replacements, you can use them for sprites too. (Shapes file sprite replacements ghost if mipmaps are enabled). It's also handy to include them for all sprites and weapons-in-hand larger than 256 pixels in size, so that users can tune down their texture quality. There's no reason to include mipmaps for interface replacements.
