Search Issue Tracker
By Design
Votes
0
Found in
2022.3.11f1
2023.1.16f1
Issue ID
UUM-53197
Regression
Yes
Script causes Console error "Reading pixels out of bounds of the current active render texture" when entering the Play mode on a HDRP project
Reproduction steps:
1. Open the attached "PROJECTFILE" project
2. Open the "Assets/OutdoorsScene.unity" scene
3. Enter the Play mode
Expected result: No errors in the Console
Actual result: Console error “Reading pixels out of bounds of the current active render texture” can be seen
Reproducible with: 2022.1.0a1, 2022.3.11f1, 2023.1.16f1, 2023.2.0a11
Not reproducible with: 2021.3.31f1, 2023.3.0a10
Fixed in: 2023.2.0a12
Reproducible on: macOS Ventura 13.6 (M1 Max), Windows 10
Not reproducible on: No other environment tested
Note:
-Couldn’t reproduce the issue with Built-in or URP, reproduced with HDRP
-The Console error on Windows is “[d3d11] attempting to ReadPixels outside of RenderTexture bounds! Reading (0, 0, 1611, 711) from (1, 1)"
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
- Inspector elements are rendered twice when the script component is added via drag-and-drop while the HideFlags.HideInInspector property is set
- Error "Light baking failed with error code 5 (Convergence data not available while rendering lightmaps)" thrown in Console when generating lighting for specific GameObjects
- Copy and Paste options for an Animation Property value are disabled in the Right click contextual menu
- Asset is not found when searching the Label "NewLabel" in Search Window
- "Compute dispatch: missing texture ID..." and "Compute dispatch: missing UAV ID..." warnings are thrown after changing the platform in High Definition 3D template
Resolution Note:
It seems that what the user wants to do is readback the result of the camera rendering by using ReadPixels.
However, as the documentation states, ReadPixels will read pixels from the currently active render target. We cannot guarantee what the current render target will be in the EndCameraRendering callback, especially in the editor when a lot of things happen outside of render pipeline rendering.
Because of that, it is recommended that users set explicitly the current render target (with the camera output texture in this case) before calling ReadPixels and not rely on an undefined behavior.