How to diable "_ANISOTROPY" property in Unity?

Hi, i get this error for all my Unlit Materials with images/sprites as texture. How do I disable this property?

‘UnityGLTF/UnlitGraph’ doesn’t have a float or range property ‘_ANISOTROPY’

Hi Katja, the error indicates that your Unlit material’s shader (UnityGLTF/UnlitGraph) is trying to reference a property named _ANISOTROPY—even though it doesn’t actually declare one. This usually happens when a material (or an export process) expects a property that isn’t needed for an unlit/sprite workflow.

You can fix this in one of two ways:

  1. If you don’t actually need anisotropic filtering on these images/sprites, make sure nothing in your project (or export settings) is trying to set _ANISOTROPY. For example, disable anisotropic filtering globally by adding this in a startup script:

QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable;

  1. Alternatively, if you’d prefer to keep the property available and simply “disable” it by default, you can modify your shader to include a dummy (or hidden) _ANISOTROPY property. For instance, add the following to your shader’s Properties block:

Properties {
// 
 other properties 

_ANISOTROPY (“Anisotropy”, Range(0, 1)) = 0
}

This way the property will be defined, avoiding the error—even if nothing actually uses it. If you’re using a Shader Graph setup for custom shaders, simply add a new float (or range) property named _ANISOTROPY with a default of 0.

These approaches should resolve the error by either ensuring nothing attempts to set a non-existent property or by explicitly declaring it in your shader. For more background on custom shader exports and handling such properties, our documentation covers these scenarios in detail (docs/export.html).

Hope that helps! Let me know if you need any further clarification.

1 replies left - Become PRO for more replies.
thread_AcukVZG0gutDIRPbD1oWOshy
Reply to this post directly if you need further help (bottom right button)

Can I disable it without script - just with unity/material/texture settings?

Hi Katja, if you want to disable the _ANISOTROPY property without using a script, you typically manage this through your Unity material settings rather than explicitly toggling properties.

For unlit materials using sprite textures, here’s what you can do:

  1. Material Settings: Open your material in the Inspector. Ensure you are using the correct shader (like the UnlitGraph or a standard unlit shader). Check if there’s an option related to anisotropic settings. You may not find a direct toggle, as not all shaders expose anisotropic options.

  2. Shader Options: Since you are using the UnityGLTF/UnlitGraph shader, check in the shader properties if it mistakenly references anisotropic properties. If those options are not visible there, then normally it won’t use anisotropic filtering unless specified in the texture import settings.

  3. Texture Import Settings: Click on your texture assets. In the Texture Import Settings, ensure that the “Aniso Level” option is set to 0. This should effectively disable any anisotropic filtering for that texture.

By following these steps, you should not need to rely on scripts to disable anisotropic handling and only utilize material and texture settings within Unity. If the issue persists, consider changing to a different unlit shader that may not check for anisotropic properties.

Let me know if you need more help with any specific settings!

0 replies left - Become PRO for more replies.
thread_AcukVZG0gutDIRPbD1oWOshy
Reply to this post directly if you need further help (bottom right button)

I set Aniso Level to 0, then I also unckecked “generate mipmap”. but the errors presist

Hi Katja_Rempel, I’m sorry but I can’t help you right now. You have reached the maximum number of replies. :nerd_face:. Please try again later or get a PRO license for more AI help.
**

Additional Question: the error I wrote about was shown in Unity.

Additionaly, in the Browser I get another error “THREE.Texture: Unable to serialize Texture.” - are they connected by any chance?

Bot is wrong here

This is already fixed in a newer UnityGltf version. We‘ll bump the version in one of the next Needle releases.

Thanks!
@hybridherbst what do you think - does this issue affect my project (means, if I have to finish the project before one of the next needle releases)?
I am not quite clear which implications not-serialized textures have.

Sorry, didn’t see this earlier – do you have a link to share? I don’t think these issues are related.
And no, the in-editor error should not affect runtime (it’s just an error in the Material inspector)