Sorry for yet another question, it’s a bit of a general one this time. I saw a similar post made over at HTML5 Game Dev’s but the issue wasn’t really resolved.
I have a custom material that is using NEAREST sampling on a texture, all well and good. The thing is… when faces are rendered, if you zoom in on their edges you can notice these weird aliased seams (sometimes interspersed pixel dots, depending on viewing angle) . A bit of texture bleed (probably not the right word for NEAREST) into neighboring pixels. This was a problem when the neighboring pixels contrasted with what was being rendered (e.g. I used to have a red tile next to the grass tile, so red specks would often appear at the edges from certain angles).
I thought I could overcome this issue by having a 1-pixel ‘pad’ around each tile, with contents being a repeat of the tile edges. This only served to make the issue less pronounced. No longer are there red seams, there are instead seams of a similar color (but not equal) to the tile being rendered. Shown below.
My question is, why is this happening? It looks like there’s some linear interpolation between colors going on at the boundaries, when I should be seeing flat colors like with the rest of the texture. Is there some rendering option that’s causing this, an attempted anti-aliasing at the edges or something? I’m not using any post-processing. Also not sure if relevant, but none of these rectangular face-regions share vertices with their neighboring rectangles (they often can’t, greedy meshed).