Texture Atlas

As the title suggests I’m trying to implement a texture atlas but I think I’m experiencing something akin to round-off error. At the very edges of my textures sometimes some color from the next texture bleeds over. Now before anyone points out that maybe the calculations for the texture coordinates is wrong I’m almost one hundred percent sure that they’re right. And the bleed is so tiny and seemingly random.

Has anyone been down this road before and has any suggestions?

You are probably victim of mip mapping bleeding the textures together. A simple way around this would be to space your textures out by some amount… and probably also extend the pixels around the edges into the gap (sort of a wide border)… at least that last part is a theory.

Even without the filtering of mip maps, there would like be some floating point bleed between adjacent textures without at least some gap between them.

Thank you ^.^ That’s kinda what I was thinking too. Just thought I’d check first.

@EmpirePhoenix implemented texture atlas and ran into the same issue.

look at this post


I was able to fix my problem, at least for the time being, by simply adding in a small buffer value that is subtracted from all the texture coordinates to move them ‘inwards’ by approximately 1 pixel.

Now a feature I would like to implement would be the ability to repeat a texture atlas image multiple times over a surface. What’s the code for that and will this ugly issue resurface when I do so? It’d be nice if such a simple trick would serve to fix both issues >.<