Jump to content
The Dark Mod Forums

converting TGA to DDS


Tels

Recommended Posts

I have written a wrapper script around tga2dds to do the conversion for every TGA file. Stil toying around, and some questions remain:

 

* ./textures/darkmod/props/textures/fireplace_wooden_d.tga - it smaller as TGA than as DDS, probably to the huge black areas and the TGA being RLE encoded. Can't this texture be cut down to half the size?

* I am skipping any "_local" and "_local[0-]+.tga" file (we have some _local2 named ones). Are there other naming schemes I missed?

* I am skipping speculars with "_s.tga". I guess these should not compressed? And do we have other naming conventions I missed?

"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

  • Replies 81
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

More info:

 

* There are 608 files and it is very slow (due to starting wine for every file)

* models/textures/darkmod/props/textures/water_mill_combined.tga crashes either wine or the compressonator. (The file looks a bit garbled at the bottom, too) Can somebody under windows please check it out and decide whats up with it?

 

Ditto crash for:

 

* models/darkmod/props/textures/bc_stair01.tga 512x96

* models/darkmod/props/textures/corner_brace_rust.tga 179x294

* models/darkmod/props/textures/table_medallion.tga 580x593

* models/darkmod/props/textures/grammo2_d.tga 384x512

* models/darkmod/props/textures/numberwheel_d.tga 64x640

* models/darkmod/props/textures/bathtube_d.tga 514x514

 

Edit: Fixed paths and added dimensions above.

"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

Can these be converted:

 

map heightmap(models/darkmod/props/textures/bc_doublebass_h, 10)

 

?

 

I think not, so for the final run I probably need to ignore _h.tga, too.

 

The biggest problem I see is that the convert creates massive amounts of data:

 

608/608 - sheetmusic01.tga: 3148996 to 1398256 bytes, 44.40% (overall 437395717 to 181206935 bytes, 41.43%)

 

Thats ~437 Mbytes TGA files to upload to the highres repo and ~ 180 Mbyte DDS to the normal SVN. Ouch.

 

Edit: The above numbers also mean that if someone built a map containing every model, you would need a graphic card with at least 512 Mbyte memory to fit all the textures in, possible even bigger (that does not count normal and specular maps), while with DDS there is a chance it fits into 256 Mbyte :)

"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

* models/textures/darkmod/props/textures/water_mill_combined.tga crashes either wine or the compressonator. (The file looks a bit garbled at the bottom, too) Can somebody under windows please check it out and decide whats up with it?

 

Ditto crash for:

 

* models/textures/darkmod/props/textures/bc_stair01.tga

* models/textures/darkmod/props/textures/corner_brace_rust.tga

* models/textures/darkmod/props/textures/table_medallion.tga

* models/textures/darkmod/props/textures/grammo2_d.tga

* models/textures/darkmod/props/textures/numberwheel_d.tga

* models/textures/darkmod/props/textures/bathtube_d.tga

 

Saving them as a dds file in photoshop works fine. I can't upload them here, betamappers can't upload such files :( .

Link to comment
Share on other sites

Saving them as a dds file in photoshop works fine. I can't upload them here, betamappers can't upload such files :( .

 

The betamapper repo doesn't allow DDS files? Strange. You can email them to me at nospam-abuse@bloodgate.com (yes, literally :) and I can then include them. And thanx! :)

"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

The betamapper repo doesn't allow DDS files? Strange. You can email them to me at nospam-abuse@bloodgate.com (yes, literally :) and I can then include them. And thanx! :)

 

Ah, uploading at the forum doesn't work. The files are in my folder in the bm repo now. I used standard settings to save them (something like dxt1 rgb no alpha).

 

I had to expand some of them a few pixels cause their dimensions were not multiples of 4. Could that be why the compressonator couldn't handle them? Hope this was not something I should not have done.

 

Let me know if they are ok.

Link to comment
Share on other sites

* I am skipping speculars with "_s.tga". I guess these should not compressed? And do we have other naming conventions I missed?

 

There's no reason not to compress speculars--we did with the brush textures.

 

./textures/darkmod/props/textures/fireplace_wooden_d.tga - it smaller as TGA than as DDS, probably to the huge black areas and the TGA being RLE encoded. Can't this texture be cut down to half the size?

 

It's not a very well-designed uvmap, I'll grant you, but there's no way to modify it without changing the model itself.

 

* I am skipping any "_local" and "_local[0-]+.tga" file (we have some _local2 named ones). Are there other naming schemes I missed?

 

You should also skip any "_h" names, as they are heightmaps used in addnormals declarations. I have a nagging feeling I've also seen some "_n" extensions, but I can't say for sure.

 

I had to expand some of them a few pixels cause their dimensions were not multiples of 4.

 

Just in case you're not aware, they only have to be multiples of 2, not 4 (which may not have helped in this case).

Link to comment
Share on other sites

I have a nagging feeling I've also seen some "_n" extensions, but I can't say for sure.

 

Yes, there are some textures with a _n extension.

 

Just in case you're not aware, they only have to be multiples of 2, not 4 (which may not have helped in this case).

 

Hmm, photoshop explicitly asks for width and height to be multiples of 4.

Link to comment
Share on other sites

@Tels: can your script check whether the texture dimensions are matching powers of two? The DDS files need to be in powers of two, otherwise the texture will be black in-game without further error message. TGA files are fine but DDS files must match.

Link to comment
Share on other sites

@Tels: can your script check whether the texture dimensions are matching powers of two? The DDS files need to be in powers of two, otherwise the texture will be black in-game without further error message. TGA files are fine but DDS files must match.

 

:wacko:

The ones converted by me are not. I can stretch them to power 2 dimensions, if this is preferable, or keep the TGA's?

Link to comment
Share on other sites

@Tels: can your script check whether the texture dimensions are matching powers of two? The DDS files need to be in powers of two, otherwise the texture will be black in-game without further error message. TGA files are fine but DDS files must match.

 

Sure, I had not even thought of doing that check.

 

However, the remark from Springheel about "need to modify the model" to modify the diffuse map (due to UV mapping) leads me to wonder if it would be okay to resize a diffuse map from lets say 1022 to 1024?

"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

Just in case you're not aware, they only have to be multiples of 2, not 4 (which may not have helped in this case).

 

Textures should (must?) be power of 2 (so 64, 128, 256, 512, 1024, but not 68 (which is a multiple of two but not a power of two). :) Coincidentily, power of two means also multiple of 4 :)

 

And since DDS seems to compress blocks of 4x4 pixels, textures that are not power of 2 will fail that check.

"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

Yes, there are some textures with a _n extension.

 

They seem all to be normal maps:

 

models/darkmod/props/textures/barrell_large_n.tga

models/darkmod/props/textures/anchor_n.tga

models/darkmod/props/textures/anvil_n.tga

models/darkmod/architecture/metalrust_n.tga

 

Should probably renamed to _local.tga. But thats for another day, I am just skipping them for now.

"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

Textures should (must?) be power of 2 (so 64, 128, 256, 512, 1024, but not 68 (which is a multiple of two but not a power of two). :) Coincidentily, power of two means also multiple of 4 :)

Just for the records, power of two does not mean multiple of 4. Take 44 as example.

 

edit: or wait, did you mean powers of 4? That would be true indeed. Ignore my post then.

edit2: scratch my whole post, I just had to re-read what you meant. I thought you meant multiple of 4 is always a power of two, not the other way around.

Link to comment
Share on other sites

Just for the records, power of two does not mean multiple of 4. Take 44 as example.

 

edit: or wait, did you mean powers of 4? That would be true indeed. Ignore my post then.

 

44 is not a power of 2 :) 2,4,8,16,32,64,128,256,512 are. But I admit I don't know what the exact rules are. All I know that a 512x96 texture is rejected :)

 

Erg, lets try this again:

 

* 16 is a power of 2 and a multiple of 4 and a multiple of 2

* 20 is not a power of 2, but a multiple of 2 and a multiple of 4

* 22 is not a power of 2, but a multiple of 2, but not a multiple of 4

 

All powers of two are also multiple of 4 (except 2) since 4 itself is a power of 2.

 

Does that make it more clear? :)

"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 was trying to convert a small director first, so to speak as a warmup and selected

 

models/darkmod/props/textures/firearrow/

 

however, that would result in:

 

dds/models/darkmod/props/textures/firearrow/

 

Doesn't that violate the 5-paths rule? I cannot find any mention of this in:

 

http://wiki.thedarkmod.com/index.php/Dds

 

tho :(

"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

Meh, now I wanted to try out the DDS converted firearrows and check that it worked, but there is a new event, so I had to recompile the source code. Now 20 mins later, I get this:

 

dlopen '/home/te/.doom3/darkmod/gamex86.so' failed: /home/te/.doom3/darkmod/gamex86.so: undefined symbol: _ZNK15RevisionTracker18GetHighestRevisio
nEv

 

Someday I hate computers........

"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

The sconscript needs to be updated, I can do that later, if nobody beats me to it.

 

Took me a while to figure out, but it should work now.

"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

The firearrow is black now, so it didn't work. Shot. :(

"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

Stretching is preferable, but beware this will mess up the scale in the editor. It's generally best to start with a canvas that has powers of two as width/height and follow the Texture Guidelines on the wiki.

 

Ok, stretch/compress to the nearest power of 2? Or only stretch out/compress? Changing dimension ratio does not mess up correct uv placement right?

Link to comment
Share on other sites

Ok, stretch/compress to the nearest power of 2? Or only stretch out/compress? Changing dimension ratio does not mess up correct uv placement right?

 

The power-of-two is needed for the conversion AFAIK. The second point, I guess so, but I really don't know for sure.

"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

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.


  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...