PDA

View Full Version : problme with KMG data



pfs
October 23rd, 2004, 16:08
i convertet from png to kmg
and the compiler says:inverted, non-twiddled loading not supported yet.

why does the -a1 not work (only -a4)
with kngenc

if i make graphic with transparent where can i know if it is 4444 or 1555

and what is the different between rgb_565 and rgb_565_TWID

what is the different between
vqenc
and
kmgenc

BlackAura
October 25th, 2004, 19:14
For some reason, -a1 was disabled. If the images you're using have only two levels of transparency, then it'll work just fine with a couple of modifications. Basically, open kmgenc.c, and find the funciton convert_to_16

Now, find the bit that looks like:

case 2:
// out[i] = le16(PACK1555(fc.a, fc.r, fc.g, fc.b));
exit(-1);
break;

and replace it with:

case 2:
if(fc.a < 0.5)
out[i] = le16(PACK1555(0, fc.r, fc.g, fc.b));
else
out[i] = le16(PACK1555(1, fc.r, fc.g, fc.b));
break;

Recompile by going to the kmgenc directory, and typing "make".

When loading a KMG, there are a few different ways to do it. I'd need to know which one you're using before I could tell you how to find out if it's 4444 or 1555.

the _TWID versions of texture formats are twiddled. Basically, that means that the texture data has been scrambled around into a format that the Dreamcast's graphics hardware can read more quickly, and it allows it to do things like bilinear filtering without much performance hit. You should always use twiddled textures unless you have a very good reason not to.

VQenc is used for creating KMG files with compressed textures in them. These can be decompressed by the Dreamcast's graphics hardware, and should be fully supported. Compressed textures look bad in some cases, but work well for photo-like textures, and you can't have any alpha channel. KMGenc creates uncompressed textures, which can have an alpha channel.