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 Asset icon is not shown on creation unless you confirm the name
- APV Sky occlusion doesn't consider the terrain
- [iOS] "EXC_BAD_ACCESS" Player crash when Script Debugging is enabled
- Cursor skips input fields when tabbing between two sets of input fields
- "Shader error redefinition of 'Varyings'" error appears when selecting the shader
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