Questions About 1px Alpha Border on Textures

1. Is the reason we have the border at all to do with subpixel rendering? My intuition is that we have the border because if a pixel maps to the edge of the texture, such that it actually tries to sample outside the texture when doing subpixel rendering, we don't want to simply use the same color as the inside pixel that is sampled, because then we will still have aliasing when sampling from the texture edges; however, by having a 1px alpha border we get what we want, since anything outside of the texture is technically completely transparent and should thus blend with a fully transparent pixel linearly. is this right?

2. Casey also mentioined here:
https://youtu.be/rWrHfGfzoOE?t=3094

that the issue with this method is mipmapping, but I have no clue why that is the case? i guess it's just because your border starts to blend, which then messes up the edge sampling, hence why border thickening is the solution, but I don't really get his digression into how mipmapping is always wrong by default because of the choice of (0,0) at the edge of a texture as opposed to the "half pixel boundary (not sure exactly what he means here)"


Edited by Draos on
1. Correct.

2. When you create a mip map level of your texture you will blend the border with one of the texture content. And so you loose the completely transparent pixel. To solve that you need to add a thicker border so that it will take several mip map level for it to disappear. Note that you may just want to have enough so that you keep the fully transparent border for the first few levels, because after that the texture might be small enough that it doesn't really matter.

I don't know about the mip map sampling issue. It would be best to ask Casey directly. If you do, please report the answer here so we can also be enlighten.
thanks for clarifying everything for me. i will post if i get a answer on Q2.
something I wonder though, is Casey mentioned when talking about mipmapping in regards to texture atlases that mipmapping can even mess up tiling textures, even when the textures are completely separate from each other i.e. not in the same atlas. I understand how something like a texture atlas can get messed up by mipmapping since nearby textures can blend into one another, but I am not sure how tiles in their own textures can suffer from mipmapping.
At some point, the mip map generation will mix everything together from the atlas (since in theory the last level is a 1px*1px texture). So at that point (well before that in fact) the tiling will be lost. But in my (small) experience this hasn't been an issue because when things mix together you're generally at a point were you can't see the details of the texture.

Maybe there are also some issue with trilinear filtering: bilinear filtering + linear filtering with the previous mip map level.

Once again, to get a definitive answer you better ask Casey what he meant.
If the tiling texture is a non-power-of-two size then, depending on how mipmapping is implemented, it might cause artifacts. Maybe that's what he meant? I don't actually know very much about how GPUs and OpenGL in particular handle that case, so I don't know what would happen in practice. It's something to look into, I suppose.