Hehe I understand how to support palettes with shaders =p. I was just wondering if you were doing it your way because you had a reason or because it's just the way you decided to support palettes (which you didn't exactly answer )
Why not generate (or load) a palette on the CPU side and generate (or load) an indexing image (rgba represents a palette index/UV coord). Then, you just send the indexing image + desired palette to the shader. That then means your entire palette shader is as simple as 2 lines:
paletteUVCoord = sample(indexTexture,UVCoord);
paletteColor= sample(altPaletteTexture,paletteUVCoord)
which means you can do a whole lot more with your palette shader due to using less instructions and zero loops.
Why not generate (or load) a palette on the CPU side and generate (or load) an indexing image (rgba represents a palette index/UV coord). Then, you just send the indexing image + desired palette to the shader. That then means your entire palette shader is as simple as 2 lines:
paletteUVCoord = sample(indexTexture,UVCoord);
paletteColor= sample(altPaletteTexture,paletteUVCoord)
which means you can do a whole lot more with your palette shader due to using less instructions and zero loops.