Search Issue Tracker
By Design
Votes
0
Found in
2021.3.46f1
2022.3.55f1
6000.0.32f1
6000.1.0a8
Issue ID
UUM-91104
Regression
No
Image becomes glitchy when using ImageConversion.EncodeNativeArrayToJPG with Custom Quality
Reproduction steps:
1. Open the attached “AsyncCaptureTest-master.zip” project
2. Open the “Assets/AsyncCapture.unity“ Scene
3. Enter the Play Mode
4. Open the project folder
5. Open the Screenshot image
6. Observe the image and see that particles are captured
7. Select the “Async Capture” GameObject in the Hierarchy window
8. Enable the Custom Quality in the Inspector window
9. Go back to the project folder
10. Open the Screenshot image again
11. Observe the image
Expected result: The image should show the particles captured and just have a different quality
Actual result: The image becomes glitchy
Reproducible with: 2021.3.46f1, 2022.3.55f1, 6000.0.32f1, 6000.1.0a8
Reproducible on: 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
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
Resolution Note:
The API EncodeNativeArrayToJPG needs a parameter `rowBytes` passed (5th parameter) before a custom quality can be passed (6th parameter). If `rowBytes` is not know, you can pass in zero. So the issue is resolved by using
`EncodeNativeArrayToJPG(buffer, rtFormat, (uint)w, (uint)h, 0, 75);`
See the documentation on how to use EncodeNativeArrayToJPG :
https://docs.unity3d.com/6000.0/Documentation/ScriptReference/ImageConversion.EncodeNativeArrayToJPG.html