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

Author Topic: sprite.setSmooth(true) is not working for reduced texture  (Read 3298 times)

0 Members and 1 Guest are viewing this topic.

Putarda

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
sprite.setSmooth(true) is not working for reduced texture
« on: September 07, 2016, 10:21:46 pm »
As title says sprite.setSmooth(true) is not working for object.getSprite()->setScale(0.1f, 0.1f);
Why? And how do i fix this? Thanks  :D

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: sprite.setSmooth(true) is not working for reduced texture
« Reply #1 on: September 07, 2016, 10:24:57 pm »
Would you mind posting a screenshot, so that we can see what "doesn't work" means? ;)
Laurent Gomila - SFML developer

Putarda

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: sprite.setSmooth(true) is not working for reduced texture
« Reply #2 on: September 07, 2016, 10:28:42 pm »

Putarda

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: sprite.setSmooth(true) is not working for reduced texture
« Reply #3 on: September 07, 2016, 10:31:29 pm »
Edges of ball are sharp

DarkRoku12

  • Full Member
  • ***
  • Posts: 203
  • Lua coder.
    • View Profile
    • Email
Re: sprite.setSmooth(true) is not working for reduced texture
« Reply #4 on: September 08, 2016, 04:15:02 am »
If you are using a sf::Shape i think that the Anti-Aliasing have more to do with it than the texture smooth filtering.

See sf::RenderWindow class and its contex settings parameter -> Anti aliasing level option.
I would like a spanish/latin community...
Problems building for Android? Look here

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: sprite.setSmooth(true) is not working for reduced texture
« Reply #5 on: September 08, 2016, 09:55:28 pm »
Enabling smooth on a sprite (or any SFML shape) applies only to its texture not the edges of the actual quad/triangles. Therefore, to enable texture smoothing for a sprite, you need to enable smooth on its texture.

As DarkRoku already mentioned, the way to "smooth" (i.e. remove aliasing) a triangle (i.e. the shape's edge) is to enable anti-aliasing.
« Last Edit: September 08, 2016, 10:45:00 pm by Hapax »
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Putarda

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: texture.setSmooth(true) is not working for reduced texture
« Reply #6 on: September 10, 2016, 11:55:27 pm »
If you are using a sf::Shape i think that the Anti-Aliasing have more to do with it than the texture smooth filtering.

See sf::RenderWindow class and its contex settings parameter -> Anti aliasing level option.
I already did that and it's still not working. Btw it's texture.setSmooth not sprite.setSmooth.

Putarda

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: sprite.setSmooth(true) is not working for reduced texture
« Reply #7 on: September 10, 2016, 11:57:28 pm »
Enabling smooth on a sprite (or any SFML shape) applies only to its texture not the edges of the actual quad/triangles. Therefore, to enable texture smoothing for a sprite, you need to enable smooth on its texture.

As DarkRoku already mentioned, the way to "smooth" (i.e. remove aliasing) a triangle (i.e. the shape's edge) is to enable anti-aliasing.
Already did that and not working...

Putarda

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: sprite.setSmooth(true) is not working for reduced texture
« Reply #8 on: September 11, 2016, 12:07:27 am »
It's working. I just had to put antialising to 100.