mapeditor / tiled

Flexible level editor
https://www.mapeditor.org/
Other
11.28k stars 1.76k forks source link

DDS Format Support #1169

Open karai17 opened 8 years ago

karai17 commented 8 years ago

It would be really awesome if Tiled could support GPU-direct formats such as DDS which allow compressed textures to be sent directly to the GPU instead of expanding them out to raw bitmap data, eating up lots of RAM and VRAM.

https://en.wikipedia.org/wiki/DirectDraw_Surface

bjorn commented 8 years ago

I have a gist where I experimented with loading a DDS file, but it requires an OpenGL context and it won't support all formats:

https://gist.github.com/bjorn/4635382

Maybe this kind of thing will be easier when Tiled is based on QtQuick...

bjorn commented 8 years ago

I noticed Qt ships with a DDS image plugin, so this will be a matter of simply shipping that DLL. I don't know what formats it all supports, but it worked for the DDS files available here.

While I'm at it I could also add the TGA image plugin.

bjorn commented 7 years ago

Issue reopened because as of Qt 5.8, the DDS image plugin is not built by default due to lack of maintenance. This means there is no DDS support as of Tiled 1.0.

coz-eduardo-hernandez commented 2 years ago

I know it's been a while, but even in 2022, DDS support would be great. My DDS files take 1/4 of my PNG files in VRAM, and also load about twice as fast, though they are 10 times larger on my hard drive, but even with DDS I'm having to juggle VRAM before those two concerns.

bjorn commented 2 years ago

@coz-eduardo-hernandez Unfortunately the issue is still that the Qt DDS image plugin is unmaintained and disabled in the qtimageformats repository. Since using DDS is only relevant for your game and not for Tiled, I would suggest you store your textures as both PNG and DDS, referring to the PNG files in your Tiled tileset files, but modifying your game to load the DDS files instead.

coz-eduardo-hernandez commented 2 years ago

I think a lot of people would benefit, not just me, but it really depend on the amount and size of images they are using in their game.

That being said, for the time being I'm just gonna create a script or something that replaces .png extensions with .dds extensions in the map file, so, I know how to work around it. However I don't think the Qt route is the best approach.

karai17 commented 2 years ago

Tiled is written in Qt so it would need to use the Qt plugin

On Fri, Nov 4, 2022, 20:13 Eduardo Hernández @.***> wrote:

I think a lot of people would benefit, not just me, but it really depend on the amount and size of images they are using in their game.

That being said, for the time being I'm just gonna create a script or something that replaces .png extensions with .dds extensions in the map file, so, I know how to work around it. However I don't think the Qt route is the best approach.

— Reply to this email directly, view it on GitHub https://github.com/mapeditor/tiled/issues/1169#issuecomment-1304329092, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEQD7GG5IJY4TYN7GRPCKTWGWKC3ANCNFSM4BX3YEEQ . You are receiving this because you authored the thread.Message ID: @.***>