ofxSpriteSheetRenderer border overlap

I’m experimenting with the ofxSpriteSheetRenderer addon and the example that comes with it is generally working well. However, I’m noticing that when it draw the sprites it is also drawing the row of pixels immediately around the area it should be drawing. The example uses an image that is 128x128 and draws 32x32 sprites. When I run it the sprites seem to be 34x34, showing pixels from neighboring images. (You can see it in the attached image as horizontal lines above and below the sprites.) I tried making my own sprite sheet and have the exact same problem. I’ve looked through the class trying to determine what might be causing the issue and haven’t been able to find it. Has anybody else experienced this issue and found a fix? I can easily draw the images with a 1 px buffer around it, so it’s not a major problem. Nevertheless, I’m curious why it’s doing this and it would be nice to not waste pixels.

Hi turowskipaul,

I had the same problem, I think this is a general problem with a texture atlas in OpenGL, therefore there is this ofEnableTextureEdgeHack() function for normal ofTexture.

I avoid this problem also with a 1 px buffer, e.g. in TexturePacker there is a Shape padding option.



OK, I see. I’ll just use the 1 px buffer then. Thanks Mike!