PDA

View Full Version : Are textures with palettes worthwhile?



Zylzyl
01-02-2014, 11:29 AM
Hello again.

I now am at a point where I want to texture geometries. I have files with textures which have 4 mipmap levels each which share a 256-color palette. So there basically is one byte per pixel which is an index to be matched to an RGB-triplet in a 768-bytes-palette.

My question is, is it worth the effort to use such a texture and haul the palette to the shader on every texture change, or should I rather convert the 0-level mipmap to pure RGB and gluBuild2DMipmaps? My gut instinct tells me the extra lookup and work isn't worth saving some memory.

Thanks for advice.

tonyo_au
01-02-2014, 04:47 PM
It is not very common to use palette images now days but if your images all share the same palette it is not necessary to load the palette with each texture change. Put the palette into a shared uniform buffer that need only be loaded once and used by any shader.

Zylzyl
01-02-2014, 05:00 PM
Oh they do use different palettes. Only the mipmaps of one texture have a shared palette among them. I decided to go pure RGB after some impatience. It works but there are other issues which require a new thread.