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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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.