DDS format in BF2 explained

Information and tutorials related to modding BF2.
AfterDune
Retired PR Developer
Posts: 17093
Joined: 2007-02-08 07:19

DDS format in BF2 explained

Post by AfterDune »

(if you find any errors, feel free to let me know, I'm just trying to help people on their way)


This tutorial will try to answer the following question: When to use what DDS format?


Okay, 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 :p . 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. Just take a look at this image, it'll explain 1000 words:

Image

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
With or without alpha.
Alpha layers are used to set transparency for example.
Ask yourself, is any part of my image transparent?

Image


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, 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).

Example of an atlas:

Image
(click to enlarge)


When to use what format

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

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:

Image

With the knowledge you now have, you should be able to save your texture in the right format :) .
Last edited by Outlawz7 on 2017-05-07 11:32, edited 1 time in total.
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: DDS format in BF2 explained

Post by Rabbit »

All because one man, saved a **** load of dxt1 files as dxt5 :D (me)
Image

AfSoccer "I just don't see the natural talent."
Image
AfterDune
Retired PR Developer
Posts: 17093
Joined: 2007-02-08 07:19

Re: DDS format in BF2 explained

Post by AfterDune »

No, I had this lying around for quite a long time. Your dxt1/dxt5 thing triggered me to finally post it up ;) .
Image
Gracler
Posts: 947
Joined: 2009-03-22 05:16

Re: DDS format in BF2 explained

Post by Gracler »

Nice tutorial. Thanks for posting it.
CTRifle
Retired PR Developer
Posts: 1056
Joined: 2011-01-03 14:57

Re: DDS format in BF2 explained

Post by CTRifle »

Glad you put this up!
Image
Image
Spyker2041
Posts: 1076
Joined: 2010-03-18 16:25

Re: DDS format in BF2 explained

Post by Spyker2041 »

Thanks for the post.

Please can you add color/detail maps to "When to use what format"
Image
Take a look at my custom PRSP Maps --> Click Here
Take a look at my gameplay vids --> Click Here
AfterDune
Retired PR Developer
Posts: 17093
Joined: 2007-02-08 07:19

Re: DDS format in BF2 explained

Post by AfterDune »

Good one. Unsure what format they should be though, DXT5?
Image
Onil
Posts: 1232
Joined: 2007-08-19 09:50

Re: DDS format in BF2 explained

Post by Onil »

ah you finally posted this :D

Thanks AD ;)
Image
Rudd
Retired PR Developer
Posts: 21225
Joined: 2007-08-15 14:32

Re: DDS format in BF2 explained

Post by Rudd »

I think this is how it goes

editor colourmaps/detailmaps/lowdetailmaps 32bit A8R8G8B8 no mips
ingame colourmaps (editor colourmaps that are compiled by the editor to include roads etc in teh texture) DXT1 10 mips
ingame detailmaps DTX1 no mips
ingame lowdetailmaps DTx1 9 mips
Image
Spyker2041
Posts: 1076
Joined: 2010-03-18 16:25

Re: DDS format in BF2 explained

Post by Spyker2041 »

With regards to minimaps, you dont rename to .png
Image
Take a look at my custom PRSP Maps --> Click Here
Take a look at my gameplay vids --> Click Here
CTRifle
Retired PR Developer
Posts: 1056
Joined: 2011-01-03 14:57

Re: DDS format in BF2 explained

Post by CTRifle »

no, they stay .dds
Image
Image
AfterDune
Retired PR Developer
Posts: 17093
Joined: 2007-02-08 07:19

Re: DDS format in BF2 explained

Post by AfterDune »

Many (if not all) PR maps have them renamed to PNG, so I figured that's how it was supposed to be. But apparently that one doesn't matter. Good then :) .
Image
Rudd
Retired PR Developer
Posts: 21225
Joined: 2007-08-15 14:32

Re: DDS format in BF2 explained

Post by Rudd »

[R-DEV]AfterDune wrote:Many (if not all) PR maps have them renamed to PNG, so I figured that's how it was supposed to be. But apparently that one doesn't matter. Good then :) .
we have them in .png so that an automated script can generate the map gallery :) the minimap itself is dds
Image
AfterDune
Retired PR Developer
Posts: 17093
Joined: 2007-02-08 07:19

Re: DDS format in BF2 explained

Post by AfterDune »

I know all those map images are .dds but for some reason we've renamed them to .png :p . Oh well.
Image
czesiek77
Posts: 26
Joined: 2014-04-20 18:56

Re: DDS format in BF2 explained

Post by czesiek77 »

And what are _b and _c textures? Example: eotech_b.dds, eotech_c.dds? I am asking becouse Eotech is reflecting like a mirror.
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: DDS format in BF2 explained

Post by Amok@ndy »

_b is usually the bump map or normal map. if its reflecting to much then its the Spec that is to brigth and needs to get toned down, the spec is usually in the Alpha Channel of the _c file but sometimes its in the Alpha of the _b file
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: DDS format in BF2 explained

Post by Rhino »

czesiek77 wrote:And what are _b and _c textures? Example: eotech_b.dds, eotech_c.dds? I am asking becouse Eotech is reflecting like a mirror.
[R-DEV]Amok@ndy wrote:_b is usually the bump map or normal map. if its reflecting to much then its the Spec that is to brigth and needs to get toned down, the spec is usually in the Alpha Channel of the _c file but sometimes its in the Alpha of the _b file
_b is the normal/bump texture, and _c is the diffuse.

Your problem is that you need to setup your material as "ColorMapGloss" in the export as the spec map is in the Diffuses (_c.dds) alpha channel and not the Normals (_b.dds) and by default it tries to load the spec from the _b.dds alpha channel.
Image
czesiek77
Posts: 26
Joined: 2014-04-20 18:56

Re: DDS format in BF2 explained

Post by czesiek77 »

My _c.dds had fully white alpha channel, and that was the problem. Thanks guys :)
Arab
PR:BF2 Developer
Posts: 2887
Joined: 2012-05-18 03:37

Re: DDS format in BF2 explained

Post by Arab »

A really good program to view DDS thumbnails is Sage Thumbs, which actually works in Windows 7 etc compared to the old Nvidia DDS tool which doesn't work in 7, 8. This way, you can view multiple .dds files at a glance without opening one after the other, and it even tells you the type of format it has and the resolution (DXT5, 300 x 300 etc)
PeppeJ
Posts: 195
Joined: 2010-11-06 10:32

Re: DDS format in BF2 explained

Post by PeppeJ »

Just felt like throwing in two nice things I've found while working on my tool

If you just want to view DDS thumbnails you can use DDS Viewer from Nvidia

And if you're not using Photoshop you can use nvDXT from Nvidia DDS Utilities to compress to .DDS
It's a commandline tool so launch it once through commandline to see options.
Image
Post Reply

Return to “Modding Tutorials”