Godot Version
4.4.1 latest
Question
Hey yall,
For my game i’m using some 2d images as Sprite 3d nodes for background objects, just placed them in the level and changed their texture filter to nearest. There’s a weird barely visible black border on the images that’s really distracting however. The image i’m using and how it looks in engine are below. Any idea on how to fix this?
the border i’m talking about, circled in blue for posterity:
Hi!
I cannot reproduce the issue on my end.
Could you share a bit more info, like the other parameters of your Sprite3D (if you did modify any)?
Also, is there any reason you want to use nearest filtering? This is mostly used for pixel art texture, for which you want no anti-aliasing, but seeing your texture, I believe linear filtering is the best fit (or maybe it’s an artistic choice, but I just want to make sure).
I have had a similar problem with Sprite3D
at relatively high zoom levels. Weirdly, in my case the fix was to use AnimatedSprite3D
, which didn’t have the same problem.
What I was seeing was artifacts around the borders of the image; in my case it was particularly noticeable because the images were mostly transparent, but close in with Sprite3D
they had borders incorrectly appearing.
Sorry for the delay - Here are all the settings on the node. Don’t think any of these would effect it, but maybe they did somehow.
Also, Thanks for the anti-aliasing tip, however i haven’t had the best results with linear as they’re still making the texture appear kind of pixelated from a distance, so i’m working on figuring those out as I go.
This is probably caused by mipmap not being generated. You can enable mipmap generation in the texture import settings directly. I’ll let you go read some more details if you’re interested, but basically: enabling mipmap will generate smaller versions of your texture, so that when the texture is seen by the camera from very far, smaller versions are used to avoid pixelated results. This at the cost of more memory usage, so it’s not an option to toggle on every texture (typically, you won’t need it on UI textures).
As for your initial issue, I indeed don’t see any parameter that seems weird to me. I would suggest you try playing around with all parameters as one may correct the problem?
Also, you may want to try leaving some transparent space at the top of your texture. This would prevent issues like bleeding or clipping, and I’m not sure about it, but it may help with your issue.
Like this (but only a few rows would be enough, here I added a lot just to show the idea):
1 Like
Thanks - i’ll try these when i get home today and update you when i do.
1 Like
Sorry this took so long - finally got a chance to get back to my pc tonight. I still can’t figure out the mipmapping stuff, but to be honest using nearest actually fits the game style more so i think i’ll go with that lol. In good news though, increasing the border size seems to have worked! i appreciate the help, probably should have made this a vector graphic looking back on it lol. I’ll close this thread now, big ups.
1 Like