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