filtering trick
here's how you cut down the number of texture samples needed for a
filter. instead of sampling two adjacent pixels, scaling by a weight,
and adding, sample at a point in between the pixel and use a different
weight. to calculate the offset between the pixels and the new weight
just set the two equations equal.
p0 * w0 + p1 * w1 = (p0 * (1 - offset) + p1 * offset) * newWeight
p0 * w0 + p1 * w1 = p0 * ((1 - offset) * newWeight) + p1 * (offset * newWeight)
w0 = (1 - offset) * newWeight
w1 = offset * newWeight
offset = w1 / (w0 + w1)
newWeight = w0 + w1
read other posts