Pseudo-bandlimited pixel art filtering in 3D: A mathematical derivation
themaister.net
themaister.net
I'm always infuriated by texture aliasing, and this is a very refreshing read of the basics. Notice that in this article the anisotropy is linearized, and near the horizon of the sampled plane this linearization breaks down. It is actually very difficult to render an infinite plane without aliasing nor blur near the horizon!
Picture zooming out from a repeating image. Eventually an entire picture takes a single pixel then multiple images per pixel. You can pick one pixel from a full image but that's going to get aliasing effects, or you can use multiple but that just means blur.
Increase the # of samples to any finite number, and you get the same problem at a higher zoom level.
The problem is that it is very difficult to filter a generic texture so that it looks perfect near the horizon. For a particular simple texture such as the checkerboard you can compute the exact rendering explicitly. But I know of no method to do it in general.
Definitely depends on hardware, but I learned recently that on my NVIDIA GPU, the transcendentals are actually in a separate pipeline, so they are free as long as you don't do too many of them! The 3 term sin approximation in the article might be slower than calling sin(), on my GPU it'd crowd the arithmetic pipe.
> This is very similar to a smoothstep, which explains why smoothstep techniques for this kind of filtering works so well.
Seems like most of the filtering I see in ShaderToy uses smoothstep(). I sort-of assumed it was a hack of convenience and availability, but it's nice to see there's some justification for using smoothstep! I'm tempted to try this pseudo-bandlimited filtering on ShaderToy.
Also the anisotropic pictures would be really nice to see with and without the algo applied.
It wouldn’t hurt to show the anisotropic pics against the other two, but FWIW, the story is more complicated since he mixed in mip-mapping for that example. He’d have to mix mip-mapping with nearest neighbor and bilinear as well, which would look sorta weird, take extra work, and possibly confuse his main point a little rather than clarify. It wouldn’t be much more illustrative than the first set of examples either. So, I’m just guessing, but I can see reasons why he might have chosen to skip the comparison.