When I have a mesh free form deformation animation, I seem to have quite a bit of pixel bleed when using mipmaps. I have the atlas set to MipMapLinearLinear, Linear, which gives a smooth look for anti-aliasing, but the FFD animations bleed.
I don't see the bleed in the editor, only in the runtime. Any suggestions?
FFD and mipmaps
- Modifié
Can you post a screenshot of what the bleeding looks like? It could be something other than mipmaps.
Hi Pharan,
Yeah, it's interesting, I just found out that it actually doesn't happen if I zoom in, so it's rather difficult to see in this image, but do you see how it looks like the bow and string are streaking a bit inside the bow? Those streaks go away when I zoom in.
Anyway, I'm pretty new to all these settings, mipmaps and whatnot, so I'm not sure what the best settings to use are.
Again, it's hard to see when it's so small, and when I zoom in (in the game) it goes away, but look at the sword, and see the artifact on the edge, as if you can see the sword twice.
If I don't use mip maps I don't see the artifacts, but then it looks all aliased and ugly.
The images are 4x that size in Spine, and I scale them by scaling the root bone of the skeleton at runtime. I'm not sure if that's the best way to do it, but I zoom in and out a lot in the game and figured I wanted a high resolution in spine and scale down from there.
Thanks!
-Nick
I see what looks like aliasing on the bowstring but the thing on the sword is definitely something.
Did you pack using Spine's texture packer? Could we see your packing settings too if you changed anything?
You shouldn't be getting any bleeding at all with the default padding settings, regardless of whether mipmaps were used.
But I guess if the mipmaps are small enough and auto-generated, it could happen. After all, mipmaps aren't generated with this kind of atlasing in mind.
What you could do in that case is increase the padding when you pack, or just pack a scaled-down atlas so you can avoid mipmapping altogether, but I guess you still want it to be high-res.
That alias-y effect you see when you map a really high-res texture on a really small shape on screen though... I think that can be avoided by using the right filtering. I'm not really that familiar with OpenGL/DirectX so I don't know what's available.
This is all libGDX stuff, right?
Yeah, it is libGDX. I'm going to keep experimenting with it, I'll let you know if I discover anything new.
The junk on the edge of the sword was fixed by increasing my edge padding from 2 to 4.
Not sure if there's an easy way to clean up the streaks in the bow though.
In case anybody hits this same thing, the solution ended up being pretty simple:
Having premultipliedalpha set to true was causing the bow to streak when using FFDs.
renderer.setPremultipliedAlpha(true);
Just FYI, premultiplied alpha is recommended for most runtimes. You usually get faster and cleaner results.
Hi Pharan,
Perhaps somebody could guide me, I have some better screenshots to better explain what I'm trying to solve.
Here is what I see when I have premultiply alpha set to true. renderer.setPremultipliedAlpha(true)
As Pharan said, some things do look better with premultiply alpha set to true, namely, the arrows are much easier to see this way.
However, the bow, which uses a FFD mesh, as you can see, is streaky and weird looking.
With premultiplied alpha set to false, the bow looks much better all around.
Does anybody have any recommendations? It doesn't seem like I can easily set only the bow to pma false and the rest of the skeleton true.
Best,
Nick
Oh, and I should mention 2 other things, in the editor everything looks perfect, not even any pixelation. I've also got the scale set to 0.25, so the image in the game is smaller, so that could be part of the issue.
When you use PMA, you need to tell SkeletonRenderer
(the libgdx class) that you are using PMA.