SFML community forums
Help => Graphics => Topic started by: Arch_Shift on September 21, 2013, 07:09:13 am
-
Let's say I have some 8x8 px pixel art, and I want to rotate and scale it. This is fine; I know how to do that. However, since it is pixel art, I can't use setSmooth(true) because it would obviously become a blurry mess. If I don't setSmooth, though, it is not antialiased, which would make it look like crap when rotated (at small sizes).
Is there any way to antialias these pixel art images without manually blowing them up in GIMP and then downscaling them to the size I need in SFML?
-
I don't think there is a better solution :-\
-
There are some anti-aliasing shaders like fxaa or smaa, but I don't know if they work with SFML.
-
Should I open up an issue on GitHub? (or do you prefer them to be on this forum?)
-
Before you do that, have you tried setting the antialiasingLevel with sf::ContextSettings (http://www.sfml-dev.org/documentation/2.1/structsf_1_1ContextSettings.php)? Or does that also give you a blurry mess?
-
Should I open up an issue on GitHub?
About what?
Before you do that, have you tried setting the antialiasingLevel with sf::ContextSettings? Or does that also give you a blurry mess?
Antialiasing smoothes geometry edges, not texture pixels. What smoothes pixels is Texture::setSmooth, but it is not suited to pixel art. The kind of blur that is required here is too sophisticated for the simple linear filtering that the graphics card provides; so yes, a shader might be the only solution here (but I have no idea what algorithms exist, and if there is even one that could give you the expected results).
-
About what?
I was thinking of a feature request for 2.x.
I have no idea what algorithms exist, and if there is even one that could give you the expected results
I know that Allegro 5 has a multisampling setting that allowed me to antialias blown-up pixel art. I'll try and look into that and find out what I can.
-
I was thinking of a feature request for 2.x.
What feature? "Making rotated/scaled pixel art magically look perfect"? :P
We don't know what the problem is, what potential solutions exist, we don't even know if this is technically possible. A feature request must be more precise, which requires some investigation.
-
I was thinking more like "Add support for FXAA / MSAA" :P
-
I doubt GLSL code will be part of SFML, shaders can be implemented on user side. So you should investigate this direction, and check if it's possible to achieve what you want ;)