Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2.0 - AntiAliasing  (Read 16831 times)

0 Members and 1 Guest are viewing this topic.

Madras

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
SFML 2.0 - AntiAliasing
« 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. :)

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFML 2.0 - AntiAliasing
« Reply #1 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML 2.0 - AntiAliasing
« Reply #2 on: July 28, 2012, 09:29:12 am »
Indeed, antialiasing smoothes the geometry edges, not the textures pixels.
Laurent Gomila - SFML developer

Madras

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: SFML 2.0 - AntiAliasing
« Reply #3 on: July 28, 2012, 06:08:44 pm »
Thank you! Now my arrow is smoothed perfectly (see screenshot). Tell me, is it possible to determine 'setSmooth(true)' as default value for any new loaded texture (like in 1.6)?  ;D
« Last Edit: July 28, 2012, 06:11:40 pm by Madras »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML 2.0 - AntiAliasing
« Reply #4 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.
« Last Edit: July 28, 2012, 06:20:31 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything