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
- Undoing Animator Parameter name change breaks references to it
- Crash on BV4_OverlapBoxAll when moving in play mode
- Custom mesh water surface normal map fades out when Y Position increases
- Sprite renderer does not issue draw calls correctly when using SRP Batcher
- [Android] Flickering artifacts when using "ScriptableRenderer.EnqueuePass(RenderPassEvent.BeforeRenderingPostProcessing)" multiple times
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