Classic Battlefield Modding Wikia
Advertisement

BF2 Image file Reference

Based on info provided by AfterDune

This tutorial will try to explain about using the DDS format, which is the common format used in BF2

we have the following topics:

  • Image dimensions
  • Formats and differences
  • Mipmaps
  • Alpha / Transparency
  • Atlas
  • When to use what format
  • How to save DDS files using Photoshop

Image dimensions[]

DDS image dimensions must be a power of 2.

Formats and differences[]

There are different formats. We'll highlight only a few in this tutorial:

  • DXT1 files are basically 4 times smaller than equivalent DXT5 ones, due to compresion algorythms and no or 1bit alpha mask
  • DXT1 only supports opaque or 1 bit alpha mask, meaning a pixel is 100% opaque or 100% transparent and no trade off
  • DXT5 supports 8bit transparency (256 shades of transparency) or 1bit alpha
  • 8.8.8.8 ARGB, no idea about this one . You only use it in one occasion as far as I'm aware. Keep on reading

Mipmaps[]

Mipmaps are pre-calculated, optimized collections of images that accompany a main texture, intended to increase rendering speed and reduce aliasing artifacts. Yes, that's a mouthful.  A simplier way to think about it is that textures that are closer to the viewer will be higher resolution than those that are further away.  There is no since using high-resolution textures that can't be seen. If you're close to the object using this texture, it will use the biggest mipmap. The further you get away from the object, the smaller the mipmap is that will be displayed, which ultimately is better for performance.

Alpha[]

Alpha layers are used to set transparency for images


Atlas[]

An atlas is nothing more than a collection of image files, combined into a single image. If the atlas image is 'full', you'll end up with multiple atlas files. That's no problem, since performance-wise it's still better to let the system open, read and close 1 or 2 (atlas) images, rather than hundreds of small images.

If you're not using an atlas, you may have to take an extra step when saving your images. This counts only for menu files though (images stored in the menu zipfiles).


When to use what format[]

Minimap Location: levels/your_mapname/hud/ Format: DXT1, no alpha, no mipmaps, rename to PNG

Map overview Location: levels/your_mapname/info/ Format: DXT1, no alpha, no mipmaps, rename to PNG

Map loading screen Location: levels/your_mapname/info/ Format: DXT1, no alpha, no mipmaps, rename to PNG

Weapon icon Location: menu/hud/texture/ingame/weapons/icons/hud/selection/ Format with atlas: 32-bit TGA Format without atlas: 32-bit TGA, flip image vertically, rename to DDS

Weapon selection icon Location: menu/hud/texture/ingame/weapons/icons/hud/selection/ Format with atlas: 32-bit TGA Format without atlas: 32-bit TGA, flip image vertically, rename to DDS

Vehicle icon Location: menu/hud/texture/ingame/vehicles/icons/hud/vehicleicons/ Format with atlas: 32-bit TGA Format without atlas: 8.8.8.8 ARGB, no mipmaps

Minimap icon Location: menu/hud/texture/ingame/vehicles/icons/minimap Format: DXT1, 1-bit alpha, no mipmaps

Object textures Information: statics, vehicles, weapons, etc. Location: objects/... Format: DXT5 (in most cases), interpolated alpha (in most cases), generate mipmaps

Sky texture Location: common/textures/sky/ Format: DXT1, no alpha, no mipmaps

Flags (minimap and scoreboard) Location: menu/hud/texture/ingame/flags/icons/hud/score/your_teamname/ Location: menu/hud/texture/ingame/flags/icons/minimap/your_teamname/ Format: DXT1, 1-bit alpha, no mipmaps

How to save DDS files using Photoshop[]

First you need to have the Nvidia DDS plugin. You can download it here. Select 32- or 64-bit, depending on what version of Photoshop you're running.

If you save your texture as DDS file, the following window will pop up:

DDS settings 005.png


With the knowledge you now have, you should be able to save your texture in the right format .

Advertisement