Page 1 of 1

anti "texture blending" for spriteBatch

Posted: Sat Jan 05, 2013 9:17 am
by AntonioModer
Texture blending - this is a gap between the tiles in spriteBatch:
bug.png
bug.png (174.21 KiB) Viewed 2857 times
Resolve:
draw in each tiles a frame, which copies the edge pixels.
Example:
example.png
example.png (10.01 KiB) Viewed 2857 times
anti-texture-blending.zip
LOVE 0.8.0 SOURCE
(10.62 KiB) Downloaded 82 times
!!!Conditions for the image:
transparent frame (1 pixel) around the sprite.

In final create tileset (atlas) (http://en.wikipedia.org/wiki/Texture_atlas)
Use free programms:
http://spritesheetpacker.codeplex.com/
http://renderhjs.net/shoebox/
Use: http://www.skn3.com/apps/objecty
Or search in google - "sprites to atlas"

Don't understand? See:
https://bitbucket.org/rude/love/issue/5 ... nt-2756034
https://bitbucket.org/rude/love/issue/3 ... n-on-float

I found another solution to the problem:
http://renderhjs.net/shoebox/
See in settings "texExtrudeSize" in "Pack Sprites". HELP-> http://renderhjs.net/shoebox/packSprites.htm

Re: anti "texture blending" for spriteBatch

Posted: Sat Jan 05, 2013 12:04 pm
by AntonioModer
anti-texture-blending-v2.1.0.zip
automation of process, auto-resize image
(9.33 KiB) Downloaded 95 times

Re: anti "texture blending" for spriteBatch

Posted: Sat Jan 05, 2013 7:23 pm
by AntonioModer
I found free atlas maker with anti "texture blending". But it is a alpha version and it don't save atlas in image. :(
http://www.skn3.com/apps/objecty
Безымянный.png
Безымянный.png (26.5 KiB) Viewed 2816 times

Re: anti "texture blending" for spriteBatch

Posted: Sat Jan 05, 2013 8:03 pm
by slime
Most texture atlas creation tools have some type of what you call "anti texture blending", usually in the form of transparent padding around the borders of images inside the texture atlas. TexturePacker is one such example.
Also, be sure to round (or floor or whatever) the x/y coordinates of images you add to your spritebatch.

Re: anti "texture blending" for spriteBatch

Posted: Sat Jan 05, 2013 8:23 pm
by Jasoco
You can also avoid these gaps by only scaling to whole numbers and flooring their values. Or by drawing onto a canvas at 1:1 and then scaling the canvas instead.

Re: anti "texture blending" for spriteBatch

Posted: Sat Jan 05, 2013 9:46 pm
by AntonioModer
Jasoco wrote:... Or by drawing onto a canvas at 1:1 and then scaling the canvas instead.
Draw slowly !

Re: anti "texture blending" for spriteBatch

Posted: Sat Jan 05, 2013 10:02 pm
by AntonioModer
slime wrote:Most texture atlas creation tools have some type of what you call "anti texture blending", usually in the form of transparent padding around the borders of images inside the texture atlas. TexturePacker is one such example.
Also, be sure to round (or floor or whatever) the x/y coordinates of images you add to your spritebatch.
I don't find any free "atlas creation tools" with this. TexturePacker not free.