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

  1. 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));
    }

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.