Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. In Project window, delete the “/Assets/CaptureScreenshotAsTexture.png“
4. Enter a new "Fixed Resolution 1280x720" item in the Game view aspect drop-down
5. Select the 1280x720 aspect item
6. Resize the GameView so that around the rendered image Unity Editor displays dark gray borders
7. Enter the Play Mode
8. Wait until the Play Mode exits automatically
9. Observe the “/Assets/CaptureScreenshotAsTexture.png“
Expected result: No dark gray borders exist and looks identical to “/Assets/CaptureScreenshot.png“
Actual result: Dark Gray borders are present
Reproducible with: 6000.0.64f1, 6000.3.2f1, 6000.4.0a5, 6000.5.0a3
Testing environment: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested
Note:
- The code that captures the screenshot is located in “/Assets/Scripts/NewMonoBehaviourScript.cs”