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
- Shader Graph Node information is briefly displayed in Graph Inspector when clicking on Category in the Blackboard
- Module installation fails with "Download failed: Validation Failed" errors when using beta.2 Hub version
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Shader Graph Category dropdown cannot be expanded/collapsed when clicking on the text
- Different text alignment in the column header in Entities "System" window
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