Tiny texture size for color palette - recommended?

Godot Version

4.5

Question

This video here: https://www.youtube.com/watch?v=KVBVqrPV878 uses color palette as texture, which is just UV Mapping.

But I see they are using 256 x 256 sized textures. What would be the benefit of using that resolution instead of having a single color per pixel that could allow us to reduce the texture size to the minimum possible?

Nowaday, with VRAM we have in GPU, this is pretty much very negligible, but I would like to optimize wherever possible. If I have 100 color palettes, this could mean the difference between 256 x 256 x 100 and perhaps 4 x 4 x 100. If I could save the resources, then why not?

So is it ok to go for tiny texture size for this case? Or is there any issue to watch out for?

You can use one pixel per color, it may help to ensure your texture sampling is set to nearest just in case, and you may have to disable mipmaps. Square textures are still beneficial as GPUs prefer them

1 Like

If you have many tiny palettes, best to pack them all into a single larger square texture whose dimension is power of 2.

2 Likes