Search Issue Tracker

By Design

Votes

0

Found in

6000.0.55f1

6000.2.1f1

6000.3.0a5

6000.4.0a1

6000.5.0a1

Issue ID

UUM-114734

Regression

Yes

Image is culled by transparency in Scene View when using a custom Canvas Material in HDRP Shader Graph

-

Reproduction steps:
1. Open the attached “IN-112737” project
2. Open the “OutdoorsScene” Scene
3. Observe the Scene View

Expected result: Images blend correctly in the Scene View, just as they do in the Game View
Actual result: The transparency incorrectly culls overlapping UI images completely

Reproducible with: 6000.0.8f1, 6000.0.55f1, 6000.2.1f1, 6000.3.0a5
Not reproducible with: 6000.0.7f1

Reproducible on: Windows 11
Not reproducible on: No other environments tested

  1. Resolution Note:

    This is a transparency sorting issue, that is not trivially solved across all customers. The current behavior was introduced while fixing a UI motion vector bug, which in my opinion is more important to fix. The workaround is to make the following single-line change:

    Packages/com.unity.render-pipelines.high-definition/Editor/Material/Canvas/ShaderGraph/HDCanvasSubTarget.cs

    ```
    public override PassDescriptor GenerateUIPassDescriptor(bool isSRP)
    {
    var pass = base.GenerateUIPassDescriptor(isSRP);

    pass.requiredFields.Add(StructFields.Varyings.texCoord2); // Motion vectors support

    // Patch render state to support motion vectors.
    pass.renderStates = new RenderStateCollection
    {
    {RenderState.Cull(Cull.Off)},
    - {RenderState.ZWrite(ZWrite.On)},
    + {RenderState.ZWrite(ZWrite.Off)},
    {RenderState.ZTest(CanvasUniforms.ZTest)},
    {RenderState.Blend(Blend.One, Blend.OneMinusSrcAlpha)},
    {RenderState.ColorMask(CanvasUniforms.ColorMask)},
    {RenderState.Stencil(new StencilDescriptor()
    {
    Ref = CanvasUniforms.Ref,
    Comp = CanvasUniforms.Comp,
    Pass = CanvasUniforms.Pass,
    ReadMask = CanvasUniforms.ReadMask,
    WriteMask = CanvasUniforms.WriteMask,
    })
    }
    };

    return pass;
    }
    ```

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.