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
- Crash on "The GUID inside 'Assets/asset.png.meta' cannot be extracted by the YAML Parser." when opening the project
- Shadows disappear when looking at a certain angle in Scene view and using Cloud Shadows with Volumetric Clouds
- StackOverflowException freezes or silently crashes the Editor
- Microsoft Surface Device freezes when detaching and reattaching physical keyboard attachment to a Microsoft Surface device in Standalone Player for Windows
- Shadows are cast with artifacts on GameObjects when the light type is set to Point
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.