Search Issue Tracker
Won't Fix
Votes
1
Found in
2019.4
2019.4.16f1
2020.2
2021.1
2021.2
Issue ID
1309841
Regression
No
Editor does not reimport Texture2DArray when Build Target is changed
How to reproduce:
1. Open the attached "Texture2DArraySwitchPlatform.zip" Project on the Android platform
2. Navigate to "Assets > textures" in the Project view
3. Notice the compression on the "New Texture2DArray.texture2darray" and other files in the directory is ASTC 6x6
4. Make sure that Asset Pipeline in Project settings is set to Version 2
5. Change the platform to Windows
6. Inspect the compression on the "New Texture2DArray.texture2darray" file
Expected Behavior: The compression is "DXT1" since the array is made of "DXT1" assets
Actual Behavior: The compression is still "ASTC"
Reproducible with: 2019.4.20f1, 2020.2.4f1, 2021.1.0b6, 2021.2.0a4
Could not test with: 2018.4, could not create texture2d array
Note:
- After you reimport the asset manually - compression is right
- Customer attached a 5min repro video "unity-assetpipeline-v2-platformchange-reimport.mp4"
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note:
The custom importer wrote by the user, in that case, is using AssetImportContext.DependsOnSourceAsset to depend on a list of Textures used during the import.
Because this importer is not only referencing the textures but also use their values, it should use AssetImportContext.DependsOnArtifact instead.
The differences between both methods are explained in their respective documentation:
https://docs.unity3d.com/2020.2/Documentation/ScriptReference/AssetImporters.AssetImportContext.DependsOnSourceAsset.html
https://docs.unity3d.com/2020.2/Documentation/ScriptReference/AssetImporters.AssetImportContext.DependsOnArtifact.html
DependsOnSourceAsset should only be used when referencing an asset without reading its values.
DependsOnArtifact should be used whenever the import result depends on the values of the other asset.