AtlasTexture scaling issue

v4.4.1.stable.official [49a5bc7b6]

Hello there! I have a scaling issue with my project. An AtlasTexture draws a one pixel line above(or sometimes beneath) the actual region. This only appears when I play in a scaled up window.

The problem is fixed, when I set “Snap 2D Transforms to Pixel” in the “Rendering” settings, but this messes up most of my tweens/animations.
I can also solve this by setting my scaling mode to “integer” instead of “float”.

You can see a row of buttons here. They utilize an atlas for every state. In my native resolution/windowed there is no issue. At a higher resolution the scaling causes the artefacts you see here.
My project is set up for 720p. When I experiment with higher resolutions or fullscreen i encounter this.

Does anyone have an idea how to solve this issue? Can I set a certain CanvasLayer to “snap 2D Transforms to Pixel”? Or is there any other option i have not found yet?

I am a novice, so there might be some completely different attempts to scaling a project for different sizes even - feel free to drop your thoughts, please :slight_smile:

That pixel line is whatever is next to the section of the atlas you’re drawing; texture filtering is blending in whatever the neighbor is at some scales.

If you want to keep using an atlas, the best option here is to redo your atlas texture and make sure you have at least a 1 pixel transparent border around everything, and then in the atlas setup you can tell it each thing has a margin. It’ll still bleed a bit, but it will bleed into transparent, so it’ll be much less obvious.

2 Likes

Thanks for your answer - I’ll mark it as a solution.
Still, I had hoped for a more elegant way of doing this.

Coming back to this because I have found a better solution to having atlases with 1px seperation: Every atlas texture has the optional toggle “Filter Clip” (filter_clip: bool) which automagically cuts all not-used atlas elements so no bleeding can happen.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.