Texture2DArray not using MipMaps?

Hi! I have a problem using mip maps with a Texture2DArray.

I have a Texture2DArray filled with some uncompressed textures with their MipMaps created. I can see the MipMaps in the Texture2DArray preview and everything seems ok.

6770281--782599--upload_2021-1-27_10-47-18.png

For some reason the MipMaps of the textures inside the Texture2DArray don’t seem to be used. When I force all the scene MipMaps to be for example a quarter of their resolution using “QualitySettings.masterTextureLimit” by code, all the textures used by standard materials seems to force the MipMaps, but this material with the Texture2DArray seems to be unnaffected.

I am using “UNITY_SAMPLE_TEX2DARRAY” inside the shader but if I force the MipMap using “UNITY_SAMPLE_TEX2DARRAY_LOD” it works, but I have to specify for all the materials using Texture2DArray’s the MipMap I want.

Shouldn’t “UNITY_SAMPLE_TEX2DARRAY” do that automatically using “QualitySettings.masterTextureLimit”?

Thanks in advance!

If I recall correctly, master texture limit will reduce the size of the resources created in GPU memory by skipping the largest mips. This saves memory whereas simply applying an LOD offset when sampling in the shader wouldn’t. Serialized textures should be recreated automatically when this setting changes. You’ll have to recreate the 2D texture array yourself as it’s created from script. I believe that in the past we did recreate textures created from code which resulted in Unity altering for example RenderTextures or lookup textures which was very much undesired.