>>3443678

>>3443694

Alright, I had a moment of clarity and no it is not the same thing at all.

A 3D LUT used for colour correction has 3 dimensions, one for red, green, blue. For example 128x128x128 LUT will have 128 shades of red, green, and blue, and every combination therein, in a meaningful pattern.

When this 3D LUT is altered, for example put through Doom's palette, the location of each colour on the 3D LUT is essentially the colour it was prior to being altered. So you can take an RGB value of (80,60,90), divide those numbers by two since we're going from 0-255 (256 values) to 128 values, and you get (40,30,45). If you go to those XYZ coords on the 3D lut, you have RGB(80,60,90) after it was put through Doom's palette.

But the uniform vec3 rgbi_palette[256] matrix or array, I'm not 100% sure which, is 1 dimensional. It's just Doom's palette, with no meaningful way of dividing it into a quick lookup table. So what the shader does is find the entry in the matrix / array / list with the closest values to the input RGB value, for every entry, which is far more expensive than turning an RGB value into an exact location to go to.