SFML community forums

General => General discussions => Topic started by: Madras on July 28, 2012, 05:21:51 am

Title: SFML 2.0 - AntiAliasing
Post by: Madras on July 28, 2012, 05:21:51 am
Hi again! I have next greenhorn question. What's happened to AntiAliasing i SFML 2.0? I remember that in 1.6 version of SFML I didn't have any problems. I tried to add these lines before RenderWindow:
Quote
sf::ContextSettings settings;
settings.antialiasingLevel = 8;
.. Nothin' happened. :D

Attached photos (first not rotated arrow sprite, second rotated one):
http://madras.srvnet.info/not_rotated.png
http://madras.srvnet.info/rotated.png

Thanks. :)
Title: Re: SFML 2.0 - AntiAliasing
Post by: binary1248 on July 28, 2012, 05:45:19 am
You might need to set your sprite to use a smoothed texture. sf::Texture has a method called setSmooth(...). You can read about it more in the SFML documentation.
Title: Re: SFML 2.0 - AntiAliasing
Post by: Laurent on July 28, 2012, 09:29:12 am
Indeed, antialiasing smoothes the geometry edges, not the textures pixels.
Title: Re: SFML 2.0 - AntiAliasing
Post by: Madras on July 28, 2012, 06:08:44 pm
Thank you! Now my arrow is smoothed perfectly (see screenshot (http://madras.srvnet.info/smoothed.png)). Tell me, is it possible to determine 'setSmooth(true)' as default value for any new loaded texture (like in 1.6)?  ;D
Title: Re: SFML 2.0 - AntiAliasing
Post by: Nexus on July 28, 2012, 06:17:35 pm
Tell me, is it possible to determine 'setSmooth(true)' as default value for any new loaded texture (like in 1.6)?  ;D
If it were a good idea, Laurent wouldn't have changed it for SFML 2.

In my opinion, the default behavior should be to render images 1:1, without special filters. With the old semantics, there have been loads of forum threads because images were drawn in a distorted way.