Bi/Tri-Linear Filtering

without bi

A simple form of texture filtering, point sampling, could be used to scale textures prior to their being mapped onto surfaces in a 3D scene. This technique could easily introduce errors by taking a too simple approach to the task.

Using a more sophisticated, though slower, technique called “bi-linear filtering”, the colour of each pixel on the target surface is calculated by averaging the colours of four adjacent texels from the source texture. Using the example texture given in point sampling, which consists of alternating black and white texels, the colour of the resulting pixel plotted to the target surface would be a grey halfway between black and white. This is obviously a much closer approximation to the way the texture should look after scaling than the result yielded by point sampling but it can also produce a blurred effect when the texture is applied to a surface close to the viewer. This can be seen in the accompanying screenshots from the game Turok. In the first screenshot, no filtering has been applied and the textures appear “blocky”; in the other, bi-linear filtering has been applied and the “blockiness” disappears to be replaced by a blurred, but more pleasing, effect.

with bi

In software that makes use of a mip-map , a more accurate result, though still blurred and even more costly in terms of processing power, can be obtained by using “tri-linear filtering”. This makes use of two copies of the texture, stored at different scales in the mip-map, by applying bi-linear filtering to the textures with scales above and below the currently required scale. The average of these two results is then taken and applied to the target surface.

Bilinear and tri-linear texture filtering are certainly a big improvement on point sampling but are only really useful on surfaces that are at right-angles to the viewer. This is because they both rely on the square as their sampling area. Anisotropic filtering is a technique more suited to texturing angled surfaces.