Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Are textures with palettes worthwhile?

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2014
    Posts
    19

    Are textures with palettes worthwhile?

    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.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,097
    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.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2014
    Posts
    19
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •