Search Issue Tracker
Won't Fix
Votes
11
Found in
2021.3.33f1
2022.3.14f1
2023.2.3f1
2023.3.0a17
Issue ID
UUM-57866
Regression
Yes
Texture becomes lower quality when the texture is downloaded with script
Reproduction steps:
1. Open the attached "(FAV) PROJECTFILE" project
2. Open the "Assets/Scenes/SampleScene 1.unity" scene
3. Enter the Play mode
4. Observe the Game view
Expected result: The “Original” and “Downloaded” textures have the same quality and have no differences
Actual result: The “Downloaded” texture quality is lower compared to the “Original” image
Reproducible with: 2021.3.29f1, 2021.3.33f1, 2022.3.14f1, 2023.2.3f1, 2023.3.0a17
Not reproducible with: 2021.3.28f1
Reproducible on: macOS Sonoma 14.1.1 (M1 Max), Windows 11
Not reproducible on: No other environment tested
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
- [Android] Stage information is not logged when Log Shader Compilation is enabled
- [Vulkan] The memory allocation increases rapidly when there are multiple (three or more) Real-Time Reflection Probes in the Scene
- [macOS] Library folder of the opened project can be deleted which leads to the crash
- “Default Scene” dropdown field contains a spelling mistake “Default Builtin”
- Editor crashes on PPtr<Mesh> after adding Text Mesh and Cloth Components to the same GameObject
Resolution Note:
In the provided sample it's the opposite: the original is of lower quality, while downloaded image looks like what is seen if opened in web browser.
The reason for the difference is because UnityWebRequest after latest changes creates texture with mipmaps enabled, while image in Unity project does not have them. Enabling mip maps for the texture in Unity project makes the "original" image look the same as downloaded. I can get the other way around by adding this code:
var copy = new Texture2D(myTexture.width, myTexture.height, myTexture.format, false);
Graphics.CopyTexture(myTexture, 0, 0, copy, 0, 0);
We plan to add public APIs to UnityWebRequest for controlling mipmap in the future. For now if you want a texture without mipmaps, use regular download and convert downloaded image bytes to texture using ImageConversion class.