<commit_before>= anisotropic_filtering
:revnumber: 2.1
:revdate: 2020/09/09



== Anisotropic Filtering for Textures

Anisotropic filtering is important for desktop games.
It sharpens textures that are viewed from an oblique angle.
Anisotropy has a performance impact, but the results look much better.

For example: link:http://i.imgur.com/0yiv9.jpg[http://i.imgur.com/0yiv9.jpg]

image::texture/anisotropy_example_mifth_01.jpg[anisotropy_example_mifth_01.jpg,width="360",height="900",align="right"]

NOTE: JME supports anisotropic filtering only on desktop platforms,
      not on mobile devices.

The maximum possible degree of anisotropy depends on the graphics hardware.
To determine this limit, simply query the renderer:

[source,java]
----
Renderer renderer = application.getRenderer();
int maxDegree = renderer.getLimits().get(Limits.TextureAnisotropy);
----

By default, anisotropic filtering is disabled.
To enable it for a specific texture, specify the desired degree of anisotropy
in the key used to load the texture.
For instance, to load a texture with 8x anisotropic filtering:

[source,java]
----
TextureKey key = new TextureKey(assetPath);
int degree = 8;
key.setAnisotropy(degree);
Texture texture = assetManager.loadTexture(key);
----

* Specifying `degree = 1` disables anisotropic filtering for the texture.
* Specifying `degree = 0` (the default) causes the loader
  to apply JME's global setting.<commit_msg>Removed dup image, try set scale of image<commit_after>= anisotropic_filtering
:revnumber: 2.1
:revdate: 2020/09/09



== Anisotropic Filtering for Textures

Anisotropic filtering is important for desktop games.
It sharpens textures that are viewed from an oblique angle.
Anisotropy has a performance impact, but the results look much better.

For example:

image::texture/anisotropy_example_mifth_01.jpg[anisotropy_example_mifth_01.jpg,width=75%]

NOTE: JME supports anisotropic filtering only on desktop platforms,
      not on mobile devices.

The maximum possible degree of anisotropy depends on the graphics hardware.
To determine this limit, simply query the renderer:

[source,java]
----
Renderer renderer = application.getRenderer();
int maxDegree = renderer.getLimits().get(Limits.TextureAnisotropy);
----

By default, anisotropic filtering is disabled.
To enable it for a specific texture, specify the desired degree of anisotropy
in the key used to load the texture.
For instance, to load a texture with 8x anisotropic filtering:

[source,java]
----
TextureKey key = new TextureKey(assetPath);
int degree = 8;
key.setAnisotropy(degree);
Texture texture = assetManager.loadTexture(key);
----

* Specifying `degree = 1` disables anisotropic filtering for the texture.
* Specifying `degree = 0` (the default) causes the loader
  to apply JME's global setting.
{'fraction_non_alphanumeric': 0.08395855662736691, 'fraction_numerical': 0.01714898177920686, 'mean_word_length': 5.047516198704104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5828994', 'n_tokens_mistral': 883, 'n_tokens_neox': 771, 'n_words': 309}