Search Issue Tracker
By Design
Votes
0
Found in
6000.0.49f1
6000.1.4f1
6000.2.0b1
6000.3.0a1
Issue ID
UUM-105286
Regression
Yes
Global textures fail to render when using an overlay Camera while MSAA is enabled
How to reproduce:
1. Open the attached “IN-99388” project
2. Open the “SampleScene”
3. Observe the Game View
Expected result: The sphere is mostly transparent with a water-like effect
Actual result: The sphere is rendered black
Reproducible with: 2023.3.0a19, 6000.0.49f1, 6000.1.4f1, 6000.2.0b1
Not reproducible with: 2023.3.0a18
Could not test with: 2021.3.51f1, 2022.3.62f1, 2023.3.0a17 (missing RenderGraph features)
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- Reproducible on Direct3D11, Direct3D12 (however, the user reported crashing on DX12)
- Not reproducible on Vulkan
- Toggling the overlay Camera (UI Camera) off and on temporarily fixes the issue, but it reappears when changing windows, entering play mode, etc., or if MSAA is toggled off and on again in the URP settings
- Enabling MSAA on the global texture fixes the issue (uncomment line 52 in the TransparentGrabPassFeature script)
- 2023.3.0a18 and 2023.3.0a19 show a shader error in the console which might affect reproduction
- 2023.3.0a19 shows the black sphere, but it does not get fixed by toggling the UI Camera (disabling MSAA still makes the issue disappear)
- Also reproducible in Player
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
- [URP] Crash on GameObject::QueryComponentByType when baking a Reflection Probe in an unsaved/untitled Scene
- No Icons are used for the Entry and Exit States in the Inspector when selected in an Animator Controller
- Crash on PlayerMain(int, char const**) when exiting Standalone Player with a Particle System in the Scene
- No Icon is used for the Runtime Animator Controller Type in a Search Window when assigning an Animator Controller in the Animator Component
- Unity Version Control server textfield’s text overlaps with the dropdown triangle button in the Explore repositories window when an organization with a long name is selected
Resolution Note:
This case has been reviewed and confirmed to be working as designed. The user is creating a Global Texture (_GrabPassTransparent) from a custom pass and utilizing it through another custom pass via DrawRenderers. For cases involving MSAA, the texture is flagged to resolve when a subsequent pass uses it.
In this specific project, when an overlay camera is used, no pass is marked to utilize the global texture. As a result, the user is using the global texture without notifying the Render Graph (RG) about this dependency. Consequently, RG is unaware of the resource dependency and may even merge the pass generating the texture with the pass that uses or samples the global texture. This gives RG no opportunity to properly resolve the texture. Conversely, when no overlay camera is present, the URP "Draw UIToolkit/uGUI Overlay" pass is automatically marked to UseAllGlobals, which triggers a read operation. This causes the texture to resolve, making it available for the user’s custom pass.
Recommended Solution:
To address this issue, the user should explicitly notify the Render Graph of the global texture dependency by including the following line in their DrawRenderers pass (TransparentObjectsRenderPass_DrawRenderers):
builder.UseGlobalTexture(Shader.PropertyToID(_settings.GlobalTextureID));
Below is the corrected code snippet for reference:
using (var builder = renderGraph.AddRasterRenderPass<PassData>($"{_name}_DrawRenderers", out var passData, _profilingSampler))
{
passData.RendererList = rendererList;
builder.AllowPassCulling(false);
builder.UseRendererList(passData.RendererList);
builder.SetRenderAttachment(source, 0);
builder.SetRenderAttachmentDepth(resourceData.activeDepthTexture);
builder.UseGlobalTexture(Shader.PropertyToID(_settings.GlobalTextureID));
builder.SetRenderFunc((PassData data, RasterGraphContext context) => ExecuteRenderListPass(data, context));
}