Closed GlennFolker closed 1 year ago
On the flip side of this I've noticed that when using a texture atlas with spacing (which I do for 2d tile map games) and default_nearest, at some zoom levels it picks the border pixels leaving my game with many vertical and horizontal lines.
I read about some artifacts coming out of MSAA however turning it on and off seems to have no impact, pretty sure it's in the texture atlas somewhere.
I'm using bevy 0.11.0 and seeing the same issue in both windows vulcan and wasm
it picks the border pixels leaving my game with many vertical and horizontal lines.
That's why some people also "bleed" the sprites one or two pixel into the padding. So for example, 4 pixels for padding and 1 pixel for bleeding.
Yes, I guess I could solve it that way. It's probably even possible to write a bit of code that takes the input tile-map (I'm not an artist I'm just using CC free stuff) spaces it out more and just duplicates the pixels on the borders.
Still probably won't look 100% pixel perfect, which makes me a little sad, but will be a lot better than the mesh of flat window background colour. Thanks for the tip.
I have a crate that implements an alternative TextureAtlasBuilder
that adds padding:
https://crates.io/crates/bevy_texture_atlas_tools
It hasn't been updated for a while because some changes in 0.10 broke my TextureAtlas crates, 0.11 reversed those changes though. It's really simple and you can probably fork it and update it yourself, or you can wait; I plan to put aside an afternoon next week to update my third-party crates (at least the useful ones).
Bevy version
0.10.0
Relevant system information
What I did
ImagePlugin::default_linear()
.TextureAtlasBuilder
.Additional information
This is most likely caused by lack of padding in the atlas texture, causing linear filtering to accidentally sample from other sprites.