SFML community forums

Help => Window => Topic started by: acrin1 on September 19, 2007, 08:22:25 pm

Title: Disabling anti-aliasing
Post by: acrin1 on September 19, 2007, 08:22:25 pm
Hi,

I've noticed that by default anti-aliasing seems to be turned on. I looked in the documentation and thought that setting the renderwindow aliasing value to 0 would disable it.

sf::RenderWindow App(sf::VideoMode(800, 600), "RPG", sf::Window::Fixed, 0 );

Am I misreading the documentation? The reason I'm asking is because I'm using small tiles (32x32) and they look better without any smoothing.

Thanks
Title: Disabling anti-aliasing
Post by: Laurent on September 19, 2007, 08:33:06 pm
Antialiasing is turned off by default.

I can see two reasons why your sprites look smooth :

- Antialiasing is forced in your driver's control panel (you should select "let the application choose")
- It's because of the texture filtering ; using Image::SetSmooth can disable it

I think it's the second one, as antialiasing only affects primitive edges. In fact it won't make any difference unless you use 3D (OpenGL) code.
Title: Disabling anti-aliasing
Post by: acrin1 on September 19, 2007, 11:22:41 pm
Quote from: "Laurent"
Antialiasing is turned off by default.

I can see two reasons why your sprites look smooth :

- Antialiasing is forced in your driver's control panel (you should select "let the application choose")
- It's because of the texture filtering ; using Image::SetSmooth can disable it

I think it's the second one, as antialiasing only affects primitive edges. In fact it won't make any difference unless you use 3D (OpenGL) code.


That's great - your second suggestion solved it:

sf::Image BackgroundImage;
    if (!BackgroundImage.LoadFromFile("images/terrain_tiles.png"))
        return EXIT_FAILURE;
   BackgroundImage.SetSmooth(false);
    sf::Sprite Background(BackgroundImage);

Thanks for your quick response.
Title: Disabling anti-aliasing
Post by: AndyZ on January 19, 2008, 04:08:20 pm
I just had to look this up to make my images appear pixel-sharp.

I would argure that either SetSmooth should be false by default and/or there should be a setDefaultSmoothing function so it does not have to be set after every image is loaded.

But it looks like a very good library otherwise  :)