| Summary: | Sprite sheet rectangle bleed | ||
|---|---|---|---|
| Product: | SDL | Reporter: | MikeyPro <michaelscottstuart> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72 |
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
|
Description
MikeyPro
2015-02-18 17:15:43 UTC
I did some more testing, when I use SDL_Hint to set linear quality, almost all textures end up bleeding in both windowed mode and fullscreen mode using the opengl renderer. This isn't really something that's caused by SDL's code. Rotating a sprite will still cause texture bleeding if the texels next to the sprite in the texture atlas are different, due to the way GPUs rasterize geometry and sample from textures. The best way to prevent sprite bleeding in texture atlases is to add a 1px extrusion to each sprite in the texture atlas (i.e. duplicate the pixels at the edges of each sprite.) Sprite packing tools such as TexturePacker and ShoeBox can do this for you automatically. http://www.matim-dev.com/texture-packer---get-rid-of-sprite-artefacts.html https://www.codeandweb.com/texturepacker/documentation#sprites If you use raw OpenGL and you target OpenGL 3+ or OpenGL ES 3+, you could use Array Textures instead of texture atlases. SDL_Render wouldn't be able to do that internally because you feed individual sprites as layers to Array Textures, rather than using a large atlas texture. I want to argue, but I wont because I'm wrong. I am really pissed this is how it must be done due to inaccuracies in underlying systems. I am setting this bug as resolved invalid. Thank you for the reply, Alex. |