Remix.run Logo
gmueckl 3 days ago

This advice is only practical if you have proper import tooling that can transparently do this conversion for your engine and preserves import settings per asset. Otherwise, this just adds a ton of fragile manual steps to asset creation.

LexiMax 3 days ago | parent | next [-]

This sort of batch asset conversion can be pretty easily automated with some combination of scripting and/or makefile.

Taking the time to learn about these sorts of compression methods is well worth it, as once you start loading assets of any appreciable scale or number, the savings in asset loading times can add up to be significant, turning what might have been a noticable jarring pause or stutter into something much less noticable.

Think about it, with hardware texture formats, not only are you not having to decode the PNG on the CPU, but you're also literally uploading less data to the GPU overall, since it can be transferred in a compressed form.

gmueckl 3 days ago | parent [-]

It's not so much the upload time/bandwidth, but some of the lossy compression algos are really slow.

flohofwoe 3 days ago | parent [-]

Why does that matter though when the compression happens 'offline' in the asset pipeline?

flohofwoe 3 days ago | parent | prev | next [-]

This can be solved with a few lines of python and a naming convention for texture file names (or alternatively a small json file per texture with metadata).

reactordev 3 days ago | parent | prev [-]

BS, Blender exports KTX2, your engine supports KTX2, Gimp exports DDS/KTX2, Substance Painter exports DDS/KTX2, three.js has a KTX2 converter.

Using image formats for texture formats is amateur game development. PNG’s are fine for icons or UI or while you’re still trying to figure out what you’re doing. Once you know, you switch to a faster, no translation required, texture formats that load faster, support physical layers, compression, and are already in BGRA format.

socalgal2 3 days ago | parent | next [-]

You should always start from source IMO.

> Blender exports KTX2, your engine supports KTX2, Gimp exports DDS/KTX2, Substance Painter exports DDS/KTX2, three.js has a KTX2 converter.

If you're manually doing this conversion from source images to shipping formats your wasting your artist's time, AND, you'll likely lose the source images since people will generally only give you what's needed to build. "Hey, could you tweak building-wall-12.ktx?" "No, It was made in Photoshop and I can't find the file with the 60 layers so no, I can't tweak. Sorry"

reactordev 3 days ago | parent [-]

In this case, the source are TIFF's, pulled from the company texture CDN... I agree you start with high resolution sources but you don't ship lower resolution PNGs unless you're on an indie game or making a browser game.

exDM69 2 days ago | parent | prev [-]

Note that KTX2 is a container format. It can contain uncompressed or compressed texture data. Some of the tools you mention might support "KTX2" but they won't compress textures for you, they just put the uncompressed data in a KTX2 container.

And my out-of-the-box Gimp 3.0.4. doesn't have KTX export at all. Didn't check the other tools you mention.

reactordev a day ago | parent [-]

Then you’re missing some plugins that were installed by default in mine.