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

Author Topic: Anisotropic Filtering  (Read 11604 times)

0 Members and 1 Guest are viewing this topic.

oomek

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • Email
Re: Anisotropic Filtering
« Reply #15 on: March 30, 2018, 02:23:12 pm »
I totally agree. Anisotropic x2 or x4 could be a default for every texture with mipmap as the performance impact is negligible, but the quality difference is huge. Upping anisotropic from x4 to x16 is less dramatic so I would leave it as a global setting configurable for all mipmapped textures.
« Last Edit: March 30, 2018, 03:07:12 pm by oomek »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Anisotropic Filtering
« Reply #16 on: March 30, 2018, 03:31:06 pm »
What would be the reason(s) to not use it by default then? Compatibility? Performances?
AF requires additional texture lookups when sampling textures in a shader. If this is a bottleneck, then yes... AF can have a performance impact. Since applications can often get GPU memory bottlenecked (GPU memory is shared by geometry, texture and other data), we shouldn't force it to be enabled, especially since it doesn't always lead to an improvement in image quality, e.g. when isotropic filtering already provides the theoretical maximum.

I also expect the PR to provide a way for the user to query the maximum AF value and also set it as they see fit. This is a trade-off that can only be made by the application developer themselves.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

oomek

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • Email
Re: Anisotropic Filtering
« Reply #17 on: March 30, 2018, 05:01:09 pm »
Would you also please address my main question from the first post? Do we need the AF specified for each mipmapped texture separately, or should the global AF level function modify the setSmooth function for all mipmapped textures so it sets AF with the globally set level instead of Bilinear?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Anisotropic Filtering
« Reply #18 on: March 30, 2018, 05:25:18 pm »
I would do this on a per-texture basis. Forcing an all-or-nothing implementation robs the user of the ability to fine tune their application performance as they see fit. They will also know best which textures would benefit from AF.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

oomek

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • Email
Re: Anisotropic Filtering
« Reply #19 on: March 30, 2018, 05:50:31 pm »
What if I made both global and local?

oomek

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • Email
Re: Anisotropic Filtering
« Reply #20 on: March 30, 2018, 05:53:26 pm »
So we have the following functions:
getMaxAnisotropyLevel() sf::Window context
setGlobalAnisotropyLevel(int level) sf::Window context
setAnisotropyLevel(int level) sf::Texture context
« Last Edit: March 30, 2018, 05:58:43 pm by oomek »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Anisotropic Filtering
« Reply #21 on: March 30, 2018, 05:59:27 pm »
If the user wants to set AF globally they will be able to do it in their own code... We don't need to provide them with this.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

oomek

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • Email
Re: Anisotropic Filtering
« Reply #22 on: March 30, 2018, 06:00:45 pm »
Ok, thanks for your input.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Anisotropic Filtering
« Reply #23 on: March 30, 2018, 06:18:01 pm »
Quote
getMaxAnisotropyLevel() sf::Window context
That would rather be in sf::Texture, similar to getMaximumSize().
Laurent Gomila - SFML developer

 

anything