Skip to content

quality

Joey Foo edited this page Feb 9, 2016 · 1 revision

About rendering quality

This page presents the different quality options that are available in openBVE. Depending on your system, you might have to trade-off visual quality against performance, but if you are lucky, there is no noticable difference in performance between all the modes and you should select the best quality option available, which is anisotropic filtering.

Nearest Neighbor

Nearest Neighbor

Bilinear

Bilinear

Nearest Neighbor (mipmapped)

Nearest Neighbor (mipmapped)

Bilinear (mipmapped)

Bilinear (mipmapped)

Trilinear (mipmapped)

Trilinear (mipmapped)

Anisotropic filtering

Anisotropic filtering

Description

When rendering the scene and a specific polygon appears at a certain pixel on the screen, Nearest Neighbor will pick the pixel in the texture that is closest to the point sampled. This creates a very sharp mosaic image, especially when the object is close. For distant objects, the pixels that are sampled from the texture can vary greatly in their distance between adjacent screen pixels, leading to a very noisy appearance.

Bilinear filtering solves the mosaic by not only selecting the nearest pixel from the texture, but the four closest pixels in two dimensions, and interpolating between those four pixels depending on which exact point needs to be sampled from the texture. This creates a smooth appearance for close objects, but it cannot overcome the problem when the object is very far away, as adjacent screen pixels might still sample from texture pixels far away from each other.

Mipmapping solves the latter problem by storing not only the texture itself in memory, but also successively reduced versions of that texture. When sampling from a texture, the first thing done is selecting which mipmap to sample from (depending on the distance to the object), so objects far away can sample from an already reduced image, thus adjacent screen pixels will sample from adjacent texture pixels. However, the distance at which one particular mipmap level is favored over another can lead to a very noticable change in texture quality.

Trilinear filtering solves this problem somewhat by not only selecting one mipmap to sample from, but the two nearest mipmap levels, bilinearly interpolating the color in each mipmap, and finally interpolating between the two mipmaps based on the distance. This creates a very smooth appearance, but the sharpness of the texture is usually lost, especially at oblique angles.

Anisotropic filtering is the most elaborate technique available in openBVE, however, it must be supported by the hardware. At very oblique angles, a rectangle on the screen will translate into a trapezoid in the texture, which is not taken into account in any of the other modes. Anisotropic filtering samples more pixels to overcome this geometric distortion in order to provide a sharp image at all angles. This is usually an expensive process, and on some routes, it can have a very diminishing effect on the frame rate.

The difference between a mipmapped (including anisotropic) and a non-mipmapped filtering is very obvious when the scene is moving, but is not as apparent in the screenshots.