Closed jiseopX closed 5 months ago
Your suggestion leads to a different computation.
r = 0.5 // => 0.5
x = 0.5/512.0 + ((0.125 - 1.0/512.0) * r) // => 0.0625
y = 63.0/512.0 * r; // => 0.0615234375
what is '0.5/512.0' for?
Assuming 512 is the size of the LUT, 0.5/512 is the size of half-texel.
It is used to shift the position by half-texel from the top left corner of the texel, so the color is not being interpolated
in your fragment shader glsl code, it calculates texture position as
texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r);
but i can't understand the meaning of the formula what is '0.5/512.0' for? why isn't it
texPos1.x = (quad1.x * 0.125) + 63.0/512.0 * textureColor.r;
?