Loading a texture in an older code, made texture look fine when it was rotated.
Now, in a newer code that seems to be the same, the same texture with same sampling mode and properties, looks jagged when it is rotated.
I tried all the modes and sampling combinations and it always looks jagged.
What is caussing the issue is the white background, if I remove it the foreground texture looks fine.
It is the same for Babylon 7 and 4. So it is not about Babylon version.
The problem is that I’m not able to determine why my previous code looks fine, and my new code look jagged with white background. The code seems to be the same.
Some idea about what is causing the jagged edges?
That’s because blending is performed with the current background at the time the sprite is drawn. When the robot is rendered first, it is blended with the dark blue background color, and when the white sprite is rendered over it, no blending occurs because the white sprite has no alpha (alpha=1 everywhere). Hence the jagged borders. When draw order is reversed, the robot will be blended with the white background color, leading to the correct blended color.
There’s no much we can do, I think… The solution would be to sort the sprites according to their depth from the camera.