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
- [Device Simulator] The non-zero touch states do not reset and are set to the "Began" state with "InProgress" being true when releasing the left-click
- Debug.DrawLine depthTest parameter starts flickering during OnSceneGUI() when SceneView.RepaintAll() is used
- [RenderGraphViewer]No help button that could lead to the documentation page
- Building "ManagedStripping" fails when a script uses a custom package
- [Quest] Visual artifacts are present when rendering Spot lights with Forward+ Rendering Path in XR
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.