ChrisViral / RealChute

Realistic parachutes for KSP
47 stars 38 forks source link

Migration to DDS textures #36

Closed sumghai closed 9 years ago

sumghai commented 9 years ago

The upcoming 1.0 version of KSP will natively support DirectDraw Surface (DDS) textures, which can be directly loaded from disk and pushed to graphic cards, resulting in significant load time savings (compared with MBMs, PNGs and TGAs, which need to be decompressed and then recompressed to the correct format).

As such, it would be wise to transition to this texture format in the next release of this plugin.

Notes

sumghai commented 9 years ago

Okay, just used Blender and @taniwha-qf's .mu importer/exporter script, and found out that DDS textures for KSP are in fact flipped vertically:

ksp texture format comparison

Should be a relatively easy fix, if the community-made KSP2DDS converter handles this properly.

Which branch should I commit the DDS textures to?

sumghai commented 9 years ago

EDIT: Looks like KSP2DDS does flip the resulting DDS texture as desired.

I should be able to get them to you tomorrow.

ChrisViral commented 9 years ago

@sumghai create your own branch off from master, I'll merge it myself.

sumghai commented 9 years ago

Aye, will do :)

sumghai commented 9 years ago

Okay, made pull requests #40 and #41 for the 2.0-dev and master branches respectively.

Please test them out in-game to make sure they look okay.

ChrisViral commented 9 years ago

Looks great, awesome work once again.

Do you think it would be possible to change the flags/icons/etc to also use DDS textures?

sumghai commented 9 years ago

Flags / icons / etc as DDS? I can do the texture conversion tonight, although it'll be up to you to figure out whether the plugin API supports DDS icons :)

ChrisViral commented 9 years ago

for the Icons, I'm loading them myself. For the flags, not a clue. We'll figure out.

sumghai commented 9 years ago

Roger that - I'll get them to you this evening.

sumghai commented 9 years ago

Okay, I've ran into some problems:

This suggests that icons / flags are unworthy of DDS compression.

Awaiting your advice on the matter :)

ChrisViral commented 9 years ago

Convert only the flags, I'll try converting the icons with this and see if I can get them to load in game properly.

EDIT: after testing, it did work, but the image abviously lost quality. Icons aren't worthy, so just go ahead with the flags.

sumghai commented 9 years ago

I've converted the flags and agencies to DDS - if they suffer from a loss in quality, you may revert my commit at your own discretion.

ChrisViral commented 9 years ago

Looks all good, though the scaled version didn't appear at all, so I reverted them back to truecolor. Awesome job once mkore though, thank you! Closing this now.

sumghai commented 9 years ago

No worries, buddy :)

I suspect that SQUAD kept the manufacturer part filter icons as .truecolor for quality reasons - I wrote something on the forums the other day about the differences in bilinear/bicubic sampling when up/downscaling images.