Search Issue Tracker
Won't Fix
Won't Fix in 2023.1.X
Votes
0
Found in
2021.3.11f1
2022.2.0b8
2023.1.0a10
Issue ID
UUM-16502
Regression
No
Camera view capture is black when adding Texture2D.ReadPixel before Camera.Render
Steps to reproduce:
1. Go to %userprofile% → AppData → LocalLow → enaielei → Unity Frameworks
2. Create a “states” folder
3. Open the “IN-15158_test” project
4. Open the “Test” Scene (Assets → Game → Scenes)
5. Enter Play mode
6. Press the “Test” button to capture and save the png
7. Open the saved picture in the “states” folder
Expected result: The picture shows the Game view
Actual result: The picture is black
Reproducible with: 2021.3.11f1, 2022.2.0b8, 2023.1.0a10
Could not test with: 2020.3.40f1 (Project does not open), 2022.1.18f1 (Console errors)
Reproduced on: Windows 10
Workaround_1:
– First 5 steps are the same
6. Go to the Main Camera then set the Camera's output texture to the RenderTexture in "Assets/Game/RenderTextures" folder
7. Remove the referenced RenderTexture/Undo the operation
8. Press the Test button to capture and save the png
Woraround_2: Add a Camera.Render before Texture2D.ReadPixel
Note: Also reproducible in the Player
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
- PlayerPropertiesChanged event fires before Player Properties are applied
- Opening Media Pop-out in “Before You Start” Tutorial throws “Styles” and “Styles_Dark” messages in the Console window
- Play Mode Scenario selection/highlight is too long and out of its bounds when the Play Mode Scenario window is opened after maximizing
- Asset name is not shown in the Undo History window when a sprite is modified
- Moving a Tab to a floating window fails when floating windows are docked next to each other
Resolution Note:
This seems to be how it is supposed to work. The work around described by the user "Add a Camera.Render before Texture2D.ReadPixel" is what should be done. Without the camera.render the rendertexture contents are not guaranteed and may contain old data or cleared data (black).
Resolution Note (2023.1.X):
This seems to be how it is supposed to work. The work around described by the user "Add a Camera.Render before Texture2D.ReadPixel" is what should be done. Without the camera.render the rendertexture contents are not guaranteed and may contain old data or cleared data (black).