kpreid/cubes — Issue #7: Add clamp-borders to block texture to avoid pixel noise
Author: kpreid
Created: 2012-01-20 03:42:59+00:00
State: open

On some GPUs, such as the one I'm currently using, there's quite a bit of pixel noise at the edges of blocks, including in thin air, where adjacent texture tiles leaking in due to imperfect interpolation or texture coordinates. Enabling antialiasing on the WebGL context also produces this problem explicitly.

I think this can be fixed by adding a one-pixel border of duplicated pixels around all texture tiles. We already support non-power-of-two tile sizes so that is not a problem, but the calculation of UV coordinates will become mildly trickier.

This will not help with pixel noise gaps between subcube faces, but it would make a fragment-shader-based solution to that problem more feasible, and such errors are less noticeable in the first place.