Scaling accuracy and spritebatches
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Scaling accuracy and spritebatches
Array texture support coming in 0.11 solves the bleeding problem on supporting hardware, and also allows for proper texture wrapping.
Re: Scaling accuracy and spritebatches
Yes that was already said above, I was just remarking that the padding used in tile software is white or transparent so is not for that use. It seems to me it's so the tiles have separation for ease of use visually. Other tile making tutorials or game making tutorials used exact size tiles normally like 16/32 etc so I didn't see how it could be a common problem in game making.
Oh really? That sounds great.grump wrote: ↑Thu Mar 01, 2018 8:42 am Array texture support coming in 0.11 solves the bleeding problem on supporting hardware, and also allows for proper texture wrapping.
Re: Scaling accuracy and spritebatches
The real problem, at least in my specific case is that I can't apply math.floor to the result of love.graphics.scale...so it's giving a decimal result and thus pixel bleed? I'm not sure of the inner workings of love.graphics.scale that's my theory.zorg wrote: ↑Thu Mar 01, 2018 8:09 am If i'm not mistaken, transparent and single-colour padding doesn't help, since if/when the gpu will try to sample beyond the defined region of the sprite itself (usually due to UV coordinate sampling happening at texture edges, and not centers, therefore the GPU interpolating between two pixel colors), it needs to find the same colors that the tile's respective edges have, otherwise you'll still see issues, like pixels being more white (if that's your padding color) or the pixel colors from "below" showing through somewhat (if your padding is transparent); this also means that you do need to "extrude" those tiles in all four directions, meaning that in most places, there will be not 1, but 2 pixels of padding between them (anywhere except the edges of the atlas itself)
Yes that's a good point. Since at least in my case it's like this; the screen is being drawn at the top left and thus being stretched towards the bottom right. So I'm only seeing pixel bleed on the right side of tiles.
While we're ranting about google, it's annoying that it always thinks I mean 'camera' when I search about 'gamera'.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Scaling accuracy and spritebatches
...on my end, Gamera gives me tons of godzilla stuff
Also, the padding should be exactly there to fix that kind of bleeding, as well as the one resulting from movement too; at least i myself had that kind of issues before.
Also, the padding should be exactly there to fix that kind of bleeding, as well as the one resulting from movement too; at least i myself had that kind of issues before.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Scaling accuracy and spritebatches
But how does it fix the issue if the padding is white ie not the same colour as the tile? For me it's already bleeding through to white since the next tile along is white.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Scaling accuracy and spritebatches
It fixes it, if you pad by repeating the last row/column, as others have said before.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Scaling accuracy and spritebatches
I think I'm a bit confused. So tiles like this with padding would fix the issue?
https://opengameart.org/sites/default/f ... review.png
https://www.spriters-resource.com/resou ... /57759.png
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Scaling accuracy and spritebatches
If all the pixels at the edges of your sprites are transparent, then the padding can also be transparent;
usually the problem comes in when you use sprites that fill up the whole unit (ground tiles instead of characters, for example), and there's no transparency around the edges. (That said, looking at the mario tileset you linked, some items do have a green background for some reason;if that's also transparency, i'd convert that to a transparent black, if i were you; löve doesn't need to use magic pink and other tricks)
But in short, it should fix the issue with that kind of tiles.
usually the problem comes in when you use sprites that fill up the whole unit (ground tiles instead of characters, for example), and there's no transparency around the edges. (That said, looking at the mario tileset you linked, some items do have a green background for some reason;if that's also transparency, i'd convert that to a transparent black, if i were you; löve doesn't need to use magic pink and other tricks)
But in short, it should fix the issue with that kind of tiles.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Scaling accuracy and spritebatches
Ok so purely square tiles for terrain would also be fine with transparent borders though right?
Ok so these ones maybe not so good then. I think the reason is often for clarity, especially with terrain tiles, without the spacing it looks like one huge block of mess lol. I'll look out for ones on a transparent background. Thanks for your help.zorg wrote: ↑Thu Mar 01, 2018 10:43 am usually the problem comes in when you use sprites that fill up the whole unit (ground tiles instead of characters, for example), and there's no transparency around the edges. (That said, looking at the mario tileset you linked, some items do have a green background for some reason;if that's also transparency, i'd convert that to a transparent black, if i were you; löve doesn't need to use magic pink and other tricks)
But in short, it should fix the issue with that kind of tiles.
But didn't you say in your first response "transparent and single-colour padding doesn't help" ?
-
- Party member
- Posts: 234
- Joined: Mon Aug 29, 2016 8:51 am
Re: Scaling accuracy and spritebatches
I set the default filter to 'nearest' and it worked for me (I have 1px of space between quads).
I'm not sure if I'm drawing at non integer positions tho.
I'm not sure if I'm drawing at non integer positions tho.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests