I have a look up texture as red channel (R8). I upload it to Pixel Shader and there I want to read pixel value (range 0 - 255) and use value for indexing an array of colors. Texture is non-power of two. If I do
float v = texture2D(s, c).r;
int index = int(v * 255);
results are not always correct. First, there is linear filter pressent, that mess up result (and for NPT texture, only linear filter is supported in ES 2.0) and sometimes also round error occurs (in interpolation of texcoord)
Is there any solution ?