Sign in to follow this  
blowfish

PSA to Part Mod Authors - Please Distribute Textures as DDS if Possible

Recommended Posts

As some of you know, KSP 1.0 now supports loading of DDS textures. These compressed* textures save both memory and loading time as they can be sent without decompression directly to GPU memory. All of the textures and effects that Squad includes with KSP are now distributed as DDS (if you noticed that 1.0 loads much faster than 0.9, now you know why). Given the numerous benefits that textures in this format provide to players, I encourage all part mod authors to distribute their mods with DDS textures.

Tools for converting textures to DDS:

Lilleman's converter

Intended for end users, but the default settings will usually generate textures that work fine for distribution

Photoshop plugin

A plugin for Adobe Photoshop which allows it to read and write DDS textures.

NVIDIA Texture Tools

Command line utilities for working with DDS textures.

Paint.net

Free image editing software for Windows

Gimp DDS plugin

A DDS plugin for GIMP.

img2dds

Cross-platform python script for converting contents of GameData to DDS. Might need some modification to work with individual folders.

What not to convert:

Icons and any textures that need to have their data accessed directly by a plugin.

Conversion settings to use:

For KSP, textures need to be flipped vertically - The NVIDIA texture tools and Photoshop plugins have settings to do this for you, and Lilleman's converter does it automatically.

The textures also need to be in the right format:

Texture Formats:

DXT1

Use this for anything without an alpha channel.

DXT5

Use this for anything with an alpha channel. This includes combined diffuse/shine maps.

DXT5nm

Use this format for normal maps.

*DDS also supports various uncompressed formats.

Edited by blowfish
clarity

Share this post


Link to post
Share on other sites

Note: the only exception is if you need read/write access to the texture ingame (as in, for example, EVE's cloud mask, where access to pixels is needed to determine where to spawn clouds). In that case, stock KSP offers no support for keeping DDS textures readable, and thus you must load them in another fashion (as png, or using DDSLoader, or manually using the new DDS code).

Share this post


Link to post
Share on other sites
GIMP DDS Plugin (also available as gimp-dds package in Debian-based distros and as gimp-dds-plugin package in Red Hat-based) is another possible option.

Share this post


Link to post
Share on other sites
Does this do the vertical flipping thing? I have a bunch of parts unwrapped on .png's, if I use this to export the same .xcf as DDS will everything line up?

You have to tell it to flip it.

Share this post


Link to post
Share on other sites

Is it just me that finds the dds converted textures horribly ugly? I've tried lillieman's, as well as the Gimp plugin, and both produce textures that look like poor quality jpegs :/ Am I doing something wrong - I tried with and without mipmaps - or is this just something you have to put up with if you're going to go for DDS?

I've also tried going back to the source xcf instead of the exported texture, but I just can't seem to get anything to look crisp as a compressed DDS.

Also, thank you for the info either way!

Edited by lo-fi

Share this post


Link to post
Share on other sites
Is it just me that finds the dds converted textures horribly ugly? I've tried lillieman's, as well as the Gimp plugin, and both produce textures that look like poor quality jpegs :/ Am I doing something wrong - I tried with and without mipmaps - or is this just something you have to put up with if you're going to go for DDS?

I've also tried going back to the source xcf instead of the exported texture, but I just can't seem to get anything to look crisp as a compressed DDS.

Also, thank you for the info either way!

In my experience DDS textures are nearly indistinguishable from the originals, so there must be something wrong with the settings you're using. You definitely want mipmaps, and you generally want to set the quality to the highest possible, though lower quality settings shouldn't produce effects anything like you're describing.

Share this post


Link to post
Share on other sites

Thanks, I'll have a play around with settings and methods and get back to you. I was surprised at the results I've been getting!

Share this post


Link to post
Share on other sites

The burden of knowledge is such that now I have to reconvert my textures with the right settings. Thanks a lot blowfish.

I've added this thread to the sticky with a note to encourage modders to convert. Wololo.

Edited by Cpt. Kipard

Share this post


Link to post
Share on other sites

Anyone use Gimp to convert to DDS what are the best settings to use ?

Share this post


Link to post
Share on other sites
What not to convert:

Icons and any textures that need to have their data accessed directly by a plugin.

Why shouldn't we convert icons?

Or is this saying "(icons and textures) that need to have their data accessed"?

Share this post


Link to post
Share on other sites
Why shouldn't we convert icons?

It causes problems, like blank icons. They're typically so small that it won't make a difference anyway, and not in power-of-two sizes so there's wasted space on conversion.

Share this post


Link to post
Share on other sites
It causes problems, like blank icons. They're typically so small that it won't make a difference anyway, and not in power-of-two sizes so there's wasted space on conversion.

Oh ok.

I went ahead and did a test conversion because I didn't have internet to read the answer, so here's the results for posterity. The icons all turned out about twice the size, except asparagus.png which saved a whopping 74 bytes on disk. I used DXT5 in Paint.net (and forgot to flip them, which was funny because everything turned out upside-down, but shouldn't affect the results).


strut.png 271
strut.dds 528 195%
sepratron.png 213
sepratron.dds 528 248%
parachute.png 256
parachute.dds 528 206%
onion.png 656
onion.dds 704 107%
nofuel.png 306
nofuel.dds 528 173%
launchclamp.png 152
launchclamp.dds 528 347%
asparagus.png 586
asparagus.dds 512 87%
asparagus-app.png 665
asparagus-app.dds 1728 260%

I was more concerned about speed (loading time) rather than on-disk size, but if there is a difference it's undetectable (under .001 seconds):


WRN 16:02:34.078] BorderedTilingSpriteMesh: Mesh has 300 or more vertices and might not be dynamically batched!
[LOG 16:02:34.149] === AutoAsparagus loading texture: AutoAsparagus/asparagus
[LOG 16:02:34.149] === AutoAsparagus loading texture: AutoAsparagus/onion
[LOG 16:02:34.149] === AutoAsparagus loading texture: AutoAsparagus/nofuel
[LOG 16:02:34.149] === AutoAsparagus loading texture: AutoAsparagus/launchclamp

[LOG 16:02:34.149] === AutoAsparagus loading texture: AutoAsparagus/parachute
[LOG 16:02:34.149] === AutoAsparagus loading texture: AutoAsparagus/sepratron
[LOG 16:02:34.150] AutoAsparagus: found SmartStage
[LOG 16:02:34.151] === AutoAsparagus loading texture: SmartStage/SmartStage38

WRN 16:08:16.542] BorderedTilingSpriteMesh: Mesh has 300 or more vertices and might not be dynamically batched!
[LOG 16:08:16.620] === AutoAsparagus loading texture: AutoAsparagus/asparagus
[LOG 16:08:16.620] === AutoAsparagus loading texture: AutoAsparagus/onion
[LOG 16:08:16.620] === AutoAsparagus loading texture: AutoAsparagus/nofuel
[LOG 16:08:16.620] === AutoAsparagus loading texture: AutoAsparagus/launchclamp
[LOG 16:08:16.620] === AutoAsparagus loading texture: AutoAsparagus/parachute
[LOG 16:08:16.620] === AutoAsparagus loading texture: AutoAsparagus/sepratron
[LOG 16:08:16.620] AutoAsparagus: found SmartStage
[LOG 16:08:16.621] === AutoAsparagus loading texture: SmartStage/SmartStage38

So, I'll stick to .png for ease of use.

Share this post


Link to post
Share on other sites

This may be a simple question, but I'm using Unity with KSP Part Tools... How do I get it to compile a part using .DDS textures instead of MBM or TGA? Or do I specify in the config file to use a DDS?

Share this post


Link to post
Share on other sites
This may be a simple question, but I'm using Unity with KSP Part Tools... How do I get it to compile a part using .DDS textures instead of MBM or TGA? Or do I specify in the config file to use a DDS?

PartTools doesn't work with DDS textures. You have to go in after the fact and replace the PNGs or whatever with DDSs. No need to change anything in the config or unity though - KSP will find the textures regardless of their extension.

Share this post


Link to post
Share on other sites

Maybe you could add img2dds to the OP - it's like Lilleman's converter, but written in Python and provided with Linux and Windows binaries. It also flips the textures and the default settings work great for me, but it includes resizing options too.

I use it on my Linux install, and for me it's quicker than Lilleman's.

Edited by UnanimousCoward

Share this post


Link to post
Share on other sites
Maybe you could add img2dds to the OP - it's like Lilleman's converter, but written in Python and provided with Linux and Windows binaries. It also flips the textures and the default settings work great for me, but it includes resizing options too.

I use it on my Linux install, and for me it's quicker than Lilleman's.

Done, though I'm not sure it'll work with individual folders (which would be the most useful for mod authors).

Share this post


Link to post
Share on other sites
Done, though I'm not sure it'll work with individual folders (which would be the most useful for mod authors).

True, but you can specify a GameData folder as a command line argument, and it seems like you only need to change "GameData" in one or all of lines 120, 126 and/or 127 to get it to work for any individual folders you like.

Share this post


Link to post
Share on other sites

FYI, Paint.NET can be added to the list. It saves directly to DDS.

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

Sign in to follow this