3 ms·
What you're suggesting might work when reading from a texture scaled around 1:1 with screen pixels. That is, 1 pixel distance on-screen is typically 0 or 1 texe
by tlb 4y ago
What you're suggesting might work when reading from a texture scaled around 1:1 with screen pixels. That is, 1 pixel distance on-screen is typically 0 or 1 texels distance in the texture map.
But when rendering an object far away, the pixel trapezoid will cover many pixels in the texture map. If you just picked the 4 corners, you'd get shimmering moire patterns. If you tried to average across all the texels, it would probably take longer than just random sampling.
You could probably implement this in a GLSL shader. The math to calculate overlaps between trapezoids and a grid is conceptually simple, though it'll be tedious to write out all the cases.