Jump to content
The Dark Mod Forums

Converting model .tgas to .dds


Springheel
 Share

Recommended Posts

It looks like it's about time to take this on. Changing our model .tga textures to .dds files could have a significant impact on loading times/performance for the release map.

 

I have too many other things on my plate to tackle this any time soon, however. Is there anyone else that has some time that wouldn't mind taking this task on? A script that would do it automatically would be fantastic, as there are a few hundred textures.

Link to comment
Share on other sites

  • Replies 143
  • Created
  • Last Reply

Top Posters In This Topic

It looks like it's about time to take this on. Changing our model .tga textures to .dds files could have a significant impact on loading times/performance for the release map.

 

I have too many other things on my plate to tackle this any time soon, however. Is there anyone else that has some time that wouldn't mind taking this task on? A script that would do it automatically would be fantastic, as there are a few hundred textures.

 

Just the diffuse and speculars, or normals too?

Link to comment
Share on other sites

The normals need to be left as is, just like the texture files.

 

As I am currently working on the package script and teaching it automatically package textures, one part of it's task will be identifing textures - and for that it needs to figure out DDS vs TGA version.

 

From that it should be only a small step to call ImageMagick and do the conversion automatically and check the DDS version into SVN.

 

Question: Does it hurt if both DDS and TGA are in SVN? (I believe we already have that case, but can't prove it at the moment).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Question: Does it hurt if both DDS and TGA are in SVN? (I believe we already have that case, but can't prove it at the moment).

 

It won't break anything, if that's what you mean. D3 chooses which one to use based on your video settings. But there's not a lot of point in having both in SVN, since people then have to download both when they first download the mod, and it could create some confusion if people only modify one version.

 

What we will probably do is move the .tga versions to the highres repository.

 

From that it should be only a small step to call ImageMagick and do the conversion automatically and check the DDS version into SVN.

 

Do you mean it would convert the .tgas to .dds? That would be great, if so. How soon would that be available? It would be nice to see what kind of performance impact that would have.

Link to comment
Share on other sites

It won't break anything, if that's what you mean. D3 chooses which one to use based on your video settings. But there's not a lot of point in having both in SVN, since people then have to download both when they first download the mod, and it could create some confusion if people only modify one version.

 

What we will probably do is move the .tga versions to the highres repository.

 

Okay.

 

Do you mean it would convert the .tgas to .dds? That would be great, if so.

 

I don't know if I can do the conversion automatically. I know I can do it manually with Gimp, but haven't tried automatically.

 

How soon would that be available? It would be nice to see what kind of performance impact that would have.

 

Dunno, I am currently hacking at the script (see devel/extract-assets.pl and the releated SVN checkins). Hopefully will be done in a few hours.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Okay.

I don't know if I can do the conversion automatically. I know I can do it manually with Gimp, but haven't tried automatically.

Dunno, I am currently hacking at the script (see devel/extract-assets.pl and the releated SVN checkins). Hopefully will be done in a few hours.

 

Btw, the progress is tracked here:

 

http://forums.thedarkmod.com/index.php?showt...st&p=153102

 

Currently I am teaching the Games::D3::Parser to correctly parse material definition files. Once it can do this, it will be easy to extract the diffusemap/specular/bumpmap for each material and then figure out the DDS vs. TGA file from it. (That's the theory, anyway :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

You can get the DDS plugin for photoshop made by NVidia, and use photoshops batch tools to automate the process. I'll try it right now.

 

I don't think this will work on Linux. :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Alright I just found a tool with the source available (it's really small) that converts tga and bmp to DDS (DXT3 w/Mipmaps), I just converted 27 megs of textures down to 4.5 megs.

 

Get it here: http://www.flipcode.com/archives/Batch_DDS...rter_Tool.shtml

You can see the source for it in there and also the source code comes with the download. Try it it works great. I checked in photoshop and the textures are saved as DXT3 with mipmaps.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Alright I just found a tool with the source available (it's really small) that converts tga and bmp to DDS (DXT3 w/Mipmaps), I just converted 27 megs of textures down to 4.5 megs.

 

Get it here: http://www.flipcode.com/archives/Batch_DDS...rter_Tool.shtml

You can see the source for it in there and also the source code comes with the download. Try it it works great. I checked in photoshop and the textures are saved as DXT3 with mipmaps.

 

Thats good to know, but the first step is to know _which_ TGAs to convert to DDS and do so automatically.

 

Edit: The tool you posted does not compile on Linux, it is for Windows only.

 

It is all great if someone does it manually now, but we will have to redo that everytime manually.

 

If you would just let me finish my script so I can detect the files automatically.........

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

You only need dxt3 if there is an alpha, otherwise dxt 1 will do, which is half the filesize.

 

Ah thanx. Hopefully this can be determined automatically, too.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

NAh, you barely notice the difference.

Also, are mip maps really necessary, since you can shave another 200kb off that by not having them.

Doesn't sound much, but over 1000 textures, that 200mb saved.

Civillisation will not attain perfection until the last stone, from the last church, falls on the last priest.

- Emil Zola

 

character models site

Link to comment
Share on other sites

NAh, you barely notice the difference.

Also, are mip maps really necessary, since you can shave another 200kb off that by not having them.

 

I think they are, because the graphic card will generate the mipmaps anyway. (which could contribute to even more on-load-stuttering, if sneaksies poor graphic card needs to generate mipmaps for 50+ textures :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I think they are, because the graphic card will generate the mipmaps anyway. (which could contribute to even more on-load-stuttering, if sneaksies poor graphic card needs to generate mipmaps for 50+ textures :)

 

Doom 3 won't show the textures in game unless you generate the mipmaps before hand, at least that's what happened to me when I tried making them without mipmaps.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

It is all great if someone does it manually now, but we will have to redo that everytime manually.

 

Why? Generate them once manually, upload them to SVN, problem solved.

Link to comment
Share on other sites

NAh, you barely notice the difference.

Also, are mip maps really necessary, since you can shave another 200kb off that by not having them.

Doesn't sound much, but over 1000 textures, that 200mb saved.

 

You're right, I can't tell the difference, the two DXT formats look almost exactly the same.

dxcompareyi2.png

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

If we're going to do this as a batch, we'd have to use DXT3, unless someone wants to manually open each texture to see if it uses any transparency.

Link to comment
Share on other sites

I thought we'd already established that we can't compress the normalmaps, or else they won't work with addnormals passes?

Link to comment
Share on other sites

If we're going to do this as a batch, we'd have to use DXT3, unless someone wants to manually open each texture to see if it uses any transparency.

 

That was my second comment about "automating it", sorry if it was to confusing. I am pretty sure ImageMagick can tell you automatically if analpha channel was used or not.

 

But let me first finish the parser and the script, and then work on the conversion.

 

(Currently the parser comes along nicely, now I just need the script to actually use the parsed information, but my head is like broccoli tonight - damn fever :(

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

For size considerations, it's worth checking. Or at least, erring on the side of making everything DXT1 and then finding the broken ones which need fixing to DXT3. It's just a matter of seeing it screwed up in game and jotting it down, or the manual method of opening it (easier and foolproof, though perhaps more tedious). Anyone can help out doing either; no reason to suddenly accept bloated sizes.

 

if sneaksies poor graphic card needs to generate mipmaps for 50+ textures

I really don't think it's a matter of the card, it's the 1.4GHz processor. The card is a GF6800 - older, but no slouch by any means, and even higher than a few other users' cards. But when the difference in launch time (D3 to main menu only, or DR with no map) between my 1.4GHz CPU and my 3.0GHz CPU is on the order of 3-4x longer at least, that's the key factor. Or, compiling a map on the 3.0 in <6 mins, but >20 mins on the 1.4. So the card is probably sitting there waiting to be handed the next set of textures. And once they're all cached, and as long as they don't go beyond some magic number in size, it runs without issue. The loading is slow, the swapping is slow. Live rendering is fine.

 

Edit:

I am pretty sure ImageMagick can tell you automatically if analpha channel was used or not.

It might be the fault of PS6.0 (known to have some bugs/limitations with alpha channels), but I see at least a blank alpha for what seems to be every darkmod DDS I open. Just so you're aware.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


  • Recent Status Updates

    • duzenko

      I vaguely recall someone recently complained about two-sided materials (curtains?) not getting lighting from both sides
      I just found a piece of code that's supposed to do just that
      Where was that discussed? (@nbohr1more?)
      · 8 replies
    • Xolvix

      I still play classic Doom (albeit with user-made mods and maps rather than the original campaign) on a regular basis. A game from the early 90's which has still got a healthy following in 2022. Pretty amazing.
      · 3 replies
    • Nort

      I'm beginning to understand why people who aren't into social clubbing "don't last long" on this project, and why it's so full of holes. When moderators are siding with bullies, by closing down threads that they derail, then I start to wonder if I should support the platform to begin with.
      I'm sure that the core development is solid, but when you're constantly tone policed and bullied, and moderators are playing into it too, then the project will just drive away talent, and replace it with socialites instead. ...and without talent, you only end up with a small skeleton crew trying to do everything themselves.
      ...so Dragofer and Airship Ballet, and all you other socialites, you win. From now on I'll just keep to myself. You'll never be able to do my work, but at least you'll be happy together, and that's what matters to you.
       
      Update
      Actually, I have to revise my statement:
      I actually messaged greebo - the top dog, I gather - about nbohr1more's outburst of insanity below, and since I haven't even heard back from him, I just have to assume that there's not a single core programmer here, who's not backing nbohr's threats. ...and that's bad.
      ...so if you're a newbie reading this, or an honest soul like ZergRush, then just slowly back out of these forums, run, and don't look back. This is nothing more than a cult posing as a game development project, using Thief and IDTech4 to sucker hopefuls in, to do work for them, while trying to cajole them into something going on behind the scenes, which apparently - according to nbohr - is something that should be hidden from the state. These people aren't programmers - they don't even understand things like how to fix the simplest bugs. All they have, is an engine, and an IP, and some sort of fascist social cult. There was some other project I saw being made in the Unreal Engine. Try joining that project. ...or start a project of your own. Anything but this asylum.
      Hopefully that was "divisive" enough for a final post, because at this point I really want people to leave this place. This project is, on a management level, just awful garbage, run by garbage people, apparently from the top down, and I'm just glad that they have a garbage place to stay, together, and hopefully forever.
      Nort
      · 6 replies
    • The Black Arrow  »  Araneidae

      A spidey! I love spideys 🕷️
      · 0 replies
    • Airship Ballet

      My guinea pig is cuter than your guinea pig https://i.imgur.com/r5VIdr0.jpeg

      · 7 replies
×
×
  • Create New...