OpenGl Shader for 8bit image?

Hi

i am trying to use OpenGl for rendering my 8Bit palleted images but i dont
have a clue.
I want to use a pixel shader to do this , it should be possible.

The 8bit image is saved as an array with idexes to the colorpallet which has
the color in RGB.
The pixel shader should know the pointer to the data array and a pointer to
the pallet.

The pallet has a size of 256 ellements.

I would be happy when some on could help me out

http://openmugen.sourceforge.net/main_new.html

Hi

i am trying to use OpenGl for rendering my 8Bit palleted images but i
dont have a clue.
I want to use a pixel shader to do this , it should be possible.

The 8bit image is saved as an array with idexes to the colorpallet
which has the color in RGB.

OpenGL pixel shaders do not work in 8bit frame buffer mode if you tried
to do that (I think you didn’t, but better to check anyway).

And if you didn’t did you check that you actually are allowed to use
that many values as shader atributes. For my GF 6600

GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 512

so only 512 components ie floats or ints etc are allowed so if your
image takes more than 256 pixels you are going over this limit.

Why aren’t you using textures for the data?

Make the palette to be one 1D texture with width of 256.

Make the image itself as a red texture or combine up to four images in
one texture.
You can then use one variable to select, which of these you want to use.
You could even mix two of them. This way you don’t waste the atribute
space for useless stuff. Only thing you should remeber is to disable
any filtering and mipmapping from the textures you use this way.On Thursday 13 April 2006 16:46, Vardar Sahin wrote:

The pixel shader should know the pointer to the data array and a
pointer to the pallet.

The pallet has a size of 256 ellements.

I would be happy when some on could help me out

http://openmugen.sourceforge.net/main_new.html