anti "texture blending" for spriteBatch

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
AntonioModer
Party member
Posts: 202
Joined: Fri Jun 15, 2012 5:31 pm
Location: Belarus
Contact:

anti "texture blending" for spriteBatch

Post by AntonioModer »

Texture blending - this is a gap between the tiles in spriteBatch:
bug.png
bug.png (174.21 KiB) Viewed 2852 times
Resolve:
draw in each tiles a frame, which copies the edge pixels.
Example:
example.png
example.png (10.01 KiB) Viewed 2852 times
anti-texture-blending.zip
LOVE 0.8.0 SOURCE
(10.62 KiB) Downloaded 81 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
Last edited by AntonioModer on Thu Jul 04, 2013 7:31 pm, edited 6 times in total.
User avatar
AntonioModer
Party member
Posts: 202
Joined: Fri Jun 15, 2012 5:31 pm
Location: Belarus
Contact:

Re: anti "texture blending" for spriteBatch

Post 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 2811 times
User avatar
slime
Solid Snayke
Posts: 3170
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: anti "texture blending" for spriteBatch

Post 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.
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: anti "texture blending" for spriteBatch

Post 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.
User avatar
AntonioModer
Party member
Posts: 202
Joined: Fri Jun 15, 2012 5:31 pm
Location: Belarus
Contact:

Re: anti "texture blending" for spriteBatch

Post by AntonioModer »

Jasoco wrote:... Or by drawing onto a canvas at 1:1 and then scaling the canvas instead.
Draw slowly !
User avatar
AntonioModer
Party member
Posts: 202
Joined: Fri Jun 15, 2012 5:31 pm
Location: Belarus
Contact:

Re: anti "texture blending" for spriteBatch

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests