ebitengine-graphics icon indicating copy to clipboard operation
ebitengine-graphics copied to clipboard

Filter options

Open mbrc12 opened this issue 2 years ago • 0 comments

It would be great to have Filter support for Sprites, similar to ebiten.FilterNearest and ebiten.FilterLinear. As far as I understand, it is useful in conjunction with scaling (or other operations on textures that require more than translation). For instance, here is a small repository showing the difference when scaled (see screenshot.png). The top line of the images use ebiten.FilterLinear, and the bottom uses the current Sprite type in this library.

https://gitlab.com/subwave/antialias-test

P.S: I am also curious as to how one may remove the jagged borders you see in both cases, presumably because only the texture is antialiased and not how it interacts with the environment (i.e., the destination screen in this case). I am not sure if that can be easily incorporated into the current design without having your own screen to write to (and then draw that image onto the true ebiten screen), but it might be good to have!

mbrc12 avatar Jun 13 '24 21:06 mbrc12