The other input is a structured buffer contained the palette as uint array.
We then sample the texture to get the palette index and read the packed color from the palette. It is then unpacked into a float4.
Before I used R8_UINT texture and Load() but using UNORM permit more filtering options.
We then sample the texture to get the palette index and read the packed color from the palette. It is then unpacked into a float4.
Before I used R8_UINT texture and Load() but using UNORM permit more filtering options.
Comments
* Store the indices as pixel value of a single channel texture
* Store the palette into a buffer instead of a texture for easier reading and less memory usage.
* Sample the indice and fetch the color from the palette in the pixel shader.