Loading the code workspace…
Write a C program that samples a small texture using nearest-neighbor and bilinear filtering.
Requirements:
Bilinear filtering, standard on every GPU texture unit since the 1990s, and mipmapping, invented by Lance Williams in 1983, together solve the magnification and minification problems that make textures look blocky or aliased in engines from id Tech to Unreal. Understanding nearest-vs-bilinear sampling is essential for writing any software renderer, image resizer, or GPU shader that samples a texture.