View Full Version : Interpolation with alpha during texture sampling

10-14-2012, 07:06 PM
My problem is best explained with a picture:

By default OpenGL interpolates all four texture channels, which is why the sampled value gets darker. I'm wondering if there is an automatic way to weigh the interpolated color value based on the alpha. So if the left square is (0,0,0,.25) and the right square is (1,0,0,1), the sampled value between the two texels should be (((0,0,0)*.25 + (1,0,0)*1)/(.25+1), (.25+1)/2) = (.8, 0, 0, .625).