The error here is potentially much bigger, because for x\<0.5 you'll actually need the left texel, and for y\<0.5 you'll need the upper one.
All it does is assume a smooth gradient texture, just like your formula. If the bottom right texel happens to be (right + bottom - current) then your formula will work exactly like a true bilinear filter but if it's not then the difference is the error (ranging from -2 to 2, which you obviously want to clamp). My formula assumes that the left texel is (2 * current - right) and the top texel is (2 * current - bottom), but since the weight factors only range to |0.5| at the edges the total maximum error is the same as your formula. However, when one of the values is higher and the other is lower then they compensate each other.
Basically, you're putting all your faith in one texel while I split it across two texels. :lol:
Which one is better appears to be influenced only by whether the gradient across the diagonal is smoother than the gradients across the x- and y-axis. My guess is this is pretty arbitrary and depends on the image.
But that probably is because you're confusing filtering with lookup. At coordinates (0.25, 0.25) you don't actually want to filter with current - 0.25 \ (right - current) - 0.25 (bottom - current). You'll want the lookup to move to one pixel up and left, and then do current + 0.75 * (right - current) + 0.75 (bottom - current)*.
That sounds way worse, since you're not even including the texel that's right below the sampling location! The impulse response of this is probably something circular. :blink:
Ideally we should fetch the three closest texels. This can be done by first horizontally fetching the two closest texels, lerping between them, then fetching and lerping vertically, and averaging the results. But note that really this fetches four texels (the one below the sample location twice) so you might as well do full bilinear (it's just one more lerp). Also, this solution wouldn't smoothly filter a perfect gradient texture. But for the average image it may actually look better as it doens't use extrapolation, only interpolation. Other interpolation solutions are to assume that the fourth texel is the average of the three fetched texels, or the two neighboring ones, or twice the current texel and once the others, which I believe might be identical to the horizontal+vertical lerp and average approach...@Mihail121
I can't explain what I'm doing because of non-disclosure agreements.
I was mainly curious whether you really need filtering of three texels, for whatever reason, or more generally a texture filter that is faster than bilinear. There are plenty of interesting alternatives.