Search Issue Tracker
By Design
Votes
3
Found in
2022.2.16f1
2023.1.0b13
2023.2.0a11
Issue ID
UUM-33869
Regression
No
Only the last call applies when calling Blitter.BlitCameraTexture multiple times
How to reproduce:
1. Open the attached project “URP14Test.zip“
2. Open the “SampleScene“ Scene
3. Enter Play Mode
Expected result: Two green vertical stripes are visible in the Game view
Actual result: One green stripe is visible in the Game view
Reproducible with: 2022.2.16f1, 2023.1.0b13, 2023.2.0a11
Can’t test with: 2020.3.47f1, 2021.3.23f1 (“error CS0115: 'ColorBlitRendererFeature.SetupRenderPasses(ScriptableRenderer, in RenderingData)': no suitable method found to override” error)
Reproduced on: macOS 13.0.1 (Intel), Windows 11 (by reporter)
Note: Issue is reproducible in Builds
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
- VFX Graph Memory leak when calling the ClearPropertyBinders and AddRemoveVFXProperty
- Entering "Configure Avatar" inside the Inspector locks it
- [Render Graph Viewer] Resource list icons cropped and in inconsistent positions
- Scene View with Debug Draw Mode enabled is gray when GPU Resident Drawer is enabled
- The UI is not visible when resizing out of focus built Player window with Application.runInBackground set to false
Resolution Note:
So in this case the blit setup is faulty and leads to this behaviour.
To avoid this problem there are several things that need to be done:
1) Main culprit of the problem is the fact, that the blit samples CameraOpaqueTexture, which is not updated inbetween the blits and therefore the second result looks unaffected by the first blit as it blitted based on the color copy which was made before the user's renderer feature blits. The Sample code can be changed in the blit shader to use _BlitTexture but ONLY if user will do what's suggested next
2) Create a temporary RTHandle to handle the blit and target swap. The color copy in this case is not needed anymore, so the target count remains the same. But the main reason for this is, that you cannot sample the texture (in this case it's _BlitTexture - the source RT set by Blitter calls), which is currently the active render target. So the blits would look like
Blitter.BlitCameraTexture(cmd, m_CameraColorTarget, tempRT, leftMaterial, -1);
Blitter.BlitCameraTexture(cmd, tempRT, m_CameraColorTarget, rightMaterial, -1);