I don’t think there’s any way to make Godot import a PNG file as any format other than RGBA8 (or I assume RGBA16 for 16 -bit pngs)?
I want to reduce the footprint of my game as much as possible (and vram use), and I only need luminance and alpha in my images - i actually really only need 3 bits (white, black and alpha).
Is there a good way to handle this? Can I make a custom import plugin that changes how PNGs are imported, so I can import as FORMAT_LA8?
Also, is there an even more ‘packed’ way to handle what are essentially bitmaps but with a third bit for transparency?
You could write your own texture storage format; you’d need to write a conversion tool to translate your source images to that format, and write a loader for Godot, but it’s not insurmountable. You could start with something that has (say):
// In C, but use the language you want...
typedef struct
{
uint32_t magic; // 'L2A1' or something for sanity checking
uint16_t x; // pixmap width
uint16_t y; // pixmap height
} L2A1_FILE_HEADER;
You could then follow that immediately in the file with a 2 bit luminance map that’s (x * y / 4) bytes in size, rounded up and zero padded, and then a 1 bit alpha map that’s (x * y / 8) bytes, rounded up and zero padded.
Your Godot loader could scribble that into an appropriate texture and send it off to the GPU.