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
- Objects with Universal Render Pipeline/Particles/Lit shader are always lit up when changing their Rendering Layer Mask
- PolySpatial “Trying to set shader on a Material Variant.” error is printed in the console when entering Play Mode
- Error “Shader error in 'YSCloudCover': call to 'tex3D' is ambiguous at Assets/YSCloudCoverText.shader(606) (on d3d11)“ is present when compiling tex3D shader with DXC
- Placeholder asset is not loaded with Advertisement Legacy sample when using the latest version of the package
- Addressables content build fails but the Player build is successful when building a development build
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