Skip to content

Convert Bioware DDS to TGA/PNG/whatever

Hi folks, I'd like to texture some models with the original Bioware textures so the objets blend perfectly into the scene, but unfortunately I've been unable so far to convert their DDS either with Photoshop with the NVidia plugins or various DDS converters I found on the web.
It looks like a poprietary format, should I just screenshot the textures from nwnexplorer or is there some way to convert those files ?

Cheers

Comments

  • AncarionAncarion Member Posts: 155
    NWNExplorer will do that directly for you. Just right click on the texture and export as TGA.
  • JapualtahJapualtah Member Posts: 165
    Thanx, I had completely forgotten about that, it's working fine !
  • TarotRedhandTarotRedhand Member Posts: 1,481
    Bioware dds is a very early (bleeding edge at the time) but now obsolete version of the format. AFAIK it is unique to NwN. However there is a new tool called "NWN Crunch" that allows you to convert between various formats including Bioware dds.

    TR
  • symmetricsymmetric Member Posts: 57
    In case you’re using nwn crunch: Please re-download the latest build (0.4) as it fixes an issue with flipped nwn dds files.
  • JapualtahJapualtah Member Posts: 165
    edited October 2018
    I noticed from the recent Workshop Beamdog work that they don't use DDS anymore and go plain TGA. Size doesn't matter nowadays (does it? ;) ), so I'm not sure whether we should be bothering with that anymore.

    Anyways, I'm old school so I value a 4.5 compression factor and still compress my textures when a model is done.
  • zordren3742zordren3742 Member Posts: 207
    edited October 2018
    Japualtah said:

    I noticed from the recent Workshop Beamdog work that they don't use DDS anymore and go plain TGA. Size doesn't matter nowadays (does it? ;) ), so I'm not sure whether we should be bothering with that anymore.

    Anyways, I'm old school so I value a 4.5 compression factor and still compress my textures when a model is done.

    That is one way to look at it, but another way to look at it is that TGA is lossless and DDS is not. So really giving the new models with the TGA is better, if anyone wants to edit or use those new textures to make something new.
  • TarotRedhandTarotRedhand Member Posts: 1,481
    Add to that, if I heard correctly, according to today's stream you'll be able to use modern dds as well as bioware dds from the next dev patch.

    TR
  • zordren3742zordren3742 Member Posts: 207
    edited October 2018
    So I did some testing on GIMPs dds import/export plugin to see what all will work in NWNEE, because "The game now supports normal DDS textures without having to mangle the header" was kind of vague, so here are some of the things that I have found out so far.

    So for everyone that does not know, there are several different compression types for dds, here are the ones that show up when you try to export from the GIMP dds plugin.

    BC1/DXT1
    BC2/DXT3
    BC3/DXT5
    BC3nm/DXT5nm
    BC4/ATI1 (3Dc+)
    BC5/ATI2 (3Dc)
    RXGB (DXT5)
    Alpha Exponent (DXT5)
    YCoCg (DXT5)
    YCoCg scaled (DXT5)

    This link will tell you "everything" tech and spec wise about the dds format:https://docs.microsoft.com/en-us/windows/desktop/direct3d11/texture-block-compression-in-direct3d-11

    And here are two more links from people testing and explaining in more normal less tech minded detail here:http://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/
    And here:http://docs.garagegames.com/torque-3d/official/content/documentation/Artist Guide/Formats/TextureCompression.html

    As far as I can tell right now, after testing all the compression types, NWNEE will render BC1/DXT1,BC2/DXT3 and BC3/DXT5 textures with and without a alpha that are exported from the gimp plugin.

    You can also select "none" on the compression setting, if you do this you will have to select a format, I tested every format and I could not get any uncompressed dds to render properly in NWNEE.

    So what type of compression should we use? I read around the internet and here is the general Consensus, for getting the best performance and file size without losing to much quality.

    If you are using a bitmap/diffuse or specular map texture that will not make use of a alpha channel, remove the alpha channel and compress into a BC1/DXT1.

    If you are using texture that will have a alpha channel and it will be used as a mask, meaning the pixels of the alpha are mostly all black or all white, which I do not think anything is in nwn, use BC2/DXT3. If you are using the alpha to blend or anything else use BC3/DXT5, most of the time people will use BC3/DXT5 with a alpha, I just wanted to throw it out there that there are people that say BC2/DXT3 is better for masking.

    Ok normal maps are a bit of a pickle right now as the only type of compression that will not mangle a normal map is BC3nm/DXT5nm which NWNEE does not support. I saw a post on the internet that showed a 256x256 uncompressed looked better and had less artifacts than a 1024x1024 compressed into BC3/DXT5. You can look here:https://forums.nexusmods.com/index.php?/topic/214873-correct-dds-texture-compressionformat/ I do not know if it is this bad in every game, but me, I would stick with TGA for the normals for now unless you want all the performance you can get, then go BC1/DXT1.

    I could not find a whole lot of information on the Use perceptual error metric setting, but I read somewhere that it is designed to increase visual quality in compressed dds images.

    I have not played with the mipmap settings much yet, but from what I have read the best mipmap filter is in Kaisers favor, they say you have to test the wrap modes in your application to get the best results with it.

    Oh and on the one texture I have used that had a alpha I had to turn on Preserve Alpha Test Coverage and I kept the Alpha Test Threshold setting at 0.50. Without turning it on, the transparent part of the texture was rendered all black. I read somewhere that it is best to use Preserve alpha test coverage anytime you use alpha, and now I know why.

    Because dds is lossy anytime that you edit a dds and recompress it, the entire image will lose quality, so make sure you do all your editing and testing on a TGA in game, then when your texture is done and in its final finished state you compress into a dds, and keep your original TGA/PNG somewhere safe on your pc or on a usb drive, that way if you ever want to go back and edit it you can.

    Also as many people have already said nwn 1.69/diamond edition or anything before NWNEE, DOES NOT support normal dds textures, you have to use the nwndds tool to convert normal TGAs to nwndds or NWN Crunch for the older versions,

    And so if you do make normal dds textures and export them from GIMP, they are not compatible and will not work with 1.69./diamond edition or anything before NWNEE.





    Post edited by zordren3742 on
  • TarotRedhandTarotRedhand Member Posts: 1,481
    edited October 2018
    @zordren3742 said

    you have to use the nwndds tool to convert normal TGAs to nwndds for the older versions


    Correction. You do not need to use that ancient tool. There is a newer one written by @symmetric called "NWN Crunch". It supports a number of different file formats. There are binaries for both windows (32 & 64 bit versions) and linux (32 & 64 bit versions).

    TR
  • zordren3742zordren3742 Member Posts: 207
    edited October 2018
    Yeah I forgot about that one, I just updated the post, thank you for catching it @TarotRedhand
  • symmetricsymmetric Member Posts: 57
    edited October 2018
    So, first things forst: I'd like to advise people NOT to use the gimp dds plugin for compression. The results are subpar. Instead use one of these: The gimp plugin is fine for opening dds files though.

    From here on it get's a little technical and NWN doesn't support most of what I lay out here. If you don't care about all that, then read no further.

    DDS compression
    I recommend reading this article about dds compression. It also contains a comparison table.
    In short: DDS compression works by dividing images into 4x4 blocks and reducing the number of colors. Instead of saving the full palette of colors for each pixel (8 bit per channel/ color in tga, i.e. 24 or 32 bit) the palette will only contain as few as 4 colors per 4x4 block. It's actually more complicated than that, but that explanation will suffice to understand the following.
    (That's why the compression is abbreviated to BC1 = Block Compression 1)

    The following formats are available:
    • BC1 (DXT1) - 4 colors per block
    • BC2 (DXT3) - 4 colors per block, 4 bit explicit alpha uncompressed (not commonly used anymore)
    • BC3 (DXT5) - 4+8 colors per block, 4 for color and an extra 8 for the alpha channel
    • BC4 - Grayscale, 8 colors per block (also known as ATI1 or 3DC+)
    • BC5 - 2xGrayscale, 8 colors per channel =2x8 per block (also known as ATI2 or 3DC or DXN)
    NWN currently only supports BC1/ DXT1 and BC3/ DXT5. As you can see there are many names floating around for the same formats, with BCx being the modern/ most recent names.


    Compressing Normal Maps
    As you might know normal maps are basically images where each pixel represents a vector, i.e. RGB values are used to represent XYZ components.

    DXT5nm/ BC3nm has been mentioned and it is essentially the same as DXT5/ BC3 with swizzled channels. Basically the Y-coordinate is stored in the Green channel, the X-coordinate in the Alpha channel and Z is dropped and later re-calculated (the normals have to be unit vectors for that). Reasons for using those particular channels:
    1. Colors are stored as RGB 5:6:5, i.e. the green channel is considered more significant than red or blue meaning better quality when using that one.
    2. The alpha channel uses an 8 color palette leading to again better quality.
    That format is still not ideal however. Ideally one would use BC5/ ATI2/ 3DC to store normals maps, because there each block contains 2 x 8 color palettes (one for each channels) to store X and Y components for each normal - as opposed to 4 + 8 color palette when using DXT5nm/ BC3nm.

    For normals, perceptual color metrics have to be disabled in the compressor. All it does is weighting the color to match the perception of the human eye (we are most sensitive in the green-yellow spectrum).
    While this results in better quality for diffuse images it is absolutely horrible for normal maps. Normal maps are simply vectors stored in the image colors, e.g. Red = X, Green = Y, Blue = Z. And the Y component is certainly not more significant than either X or Z.

    TL:DR: BC5 & uniform/euclidean color metrics is best for normal maps.



    For single channel maps BC4/ ATI1 would be best, as it offers the best quality (8 color palette) while only storing a single channel, meaning there would be no wasted space because of unused channels.. (Single channel maps = specular, roughness, glowmap, etc.)
  • zordren3742zordren3742 Member Posts: 207
    edited October 2018
    I did not mention BC5/ATI2/3DC for two reasons, of all the stuff I read on the internet, no one ever mentioned it and I knew NWNEE does not support it. But more info for everyone is always a plus. I can confirm what @Symmetric said about GIMP, I have heard not to use it because the compression quality is not as good as other software. That was just the one that I used to do some testing. I am no expert on the dds format, I was just trying to be helpful to anyone that might want to know more about it.
    Post edited by zordren3742 on
  • zordren3742zordren3742 Member Posts: 207
    edited October 2018
    So I was looking around internet trying to figure out which dds compressor I will try next,I think I'm going to try compressonator. I did see someone mention this one as well from some guys that work/worked at Intel in 2012. https://software.intel.com/en-us/articles/fast-ispc-texture-compressor-update Sorry I was updating this last night and forgot to post. This one you have to build in a compiler first like nvidia tools 2,so it might be more for people like @Symmetric.
    Post edited by zordren3742 on
  • zordren3742zordren3742 Member Posts: 207
    I know I ask alot of things about technical things that I do not know anything about. But please understand that I am trying to learn, and do not expect anyone to write me a 10 step guide on how to do things just for asking. Feel free to correct me on things that I am wrong about.
  • symmetricsymmetric Member Posts: 57
    No problem. Actually the more I deal with dds the more I realize that the standards are rarely obeyed. A lot of tools and engines do their own things, it's messy.

    Compressonator is good choice. The files it produces conform to the standards. You don't have to build it yourself, there are binaries available on the github page: https://github.com/GPUOpen-Tools/Compressonator/releases. Granted it's a bit hidden.

    The gimp plugin and the nvidia tools don't always conform to the standards. So personally I'd recommend Compressonator or Crunch. But with crunch you have to set the right options, which are not documented all that well - something I will have to rectify sooner or later.
Sign In or Register to comment.