Search Issue Tracker
By Design
Votes
1
Found in [Package]
12.1.6
Issue ID
1397952
Regression
No
Incorrect rendering when Intermediate Texture is set to "Auto"
Reproduction steps:
1. Open the user's attached project "BugReport.zip"
2. Observe the Game view
Expected result: The Game view has a yellow tint
Actual result: The Game view is gray and blue without a yellow tint
Reproducible with: 12.1.6 (2021.2.17f1),
Could not test with: 7.7.1 (2019.4.37f1), 10.8.1 (2020.3.32f1) (No Intermediate Texture), 13.1.7 (2022.1.0b14), 14.0.1 (2022.2.0a8) ("You can only call cameraColorTarget inside the scope of a ScriptableRenderPass. Otherwise the pipeline camera target texture might have not been created or might have already been disposed.")
Note: Correct result can be seen if Intermediate Texture is set to "Always"
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
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
Resolution Note:
The issue is that cameraColorTarget is accessed in AddRenderPasses. At that stage, cameraColorTarget is not properly configured because it requires input info set by ConfigureInput, which is also called in AddRenderPasses. That means there is no way to figure out cameraColorTarget inside the AddRenderPasses.
This use case works before because intermediate texture is always in use so cameraColorTarget always point to intermediate texture. See (https://github.com/Unity-Technologies/Graphics/pull/2377)
Unfortunately I think this is a by-design issue. To by pass the issue, user could either
1. Set intermediate texture mode to Always to get around the issue or
2. Access renderingData.cameraData.renderer.cameraColorTarget inside the Execute function instead of AddRenderPasses.
In latest URP 2021.2, we changed default setting for intermediate texture mode to Always to avoid future issues like this.(https://ono.unity3d.com/unity/unity/pull-request/140407/_/2021.2/universal/backport-intermediate-texture-fix)
In URP 2022.1, we properly solved this issue by introducing the SetupRenderPasses call(See upgrade guide https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@13.1/manual/upgrade-guide-2022-1.html)