Search Issue Tracker

By Design

Votes

0

Found in

2020.3

2020.3.16f1

2021.1

2021.2

2022.1

Issue ID

1361575

Regression

No

GameObject in the Game View gets clipped when changing Dynamic Resolution using DirectX12

HD RP

-

Steps to reproduce:
1. Open the user-provided project in "Lighting.zip"
2. Enter Play Mode
3. In Hierarchy Windows select "Dynamic Resolution Handler"
4. In the Inspector window under the "Dynamic Res" script component change the "Dynamic res" value to 0
5. Observe the Game view

Expected result: "Cube" GameObject is visible in the Game view
Actual result: "Cube" GameObject is not visible in the Game view

Reproducible with: 2020.3.21f1, 2021.1.26f1, 2021.2.0b16, 2022.1.0a12
Couldn't test with: 2019.4.31f1 - the project wouldn't load due to compilation errors

Notes:
- does not reproduce when using DirectX11
- only reproducible when Dynamic Resolution Type is set to Hardware in HDRP asset file
- does not reproduce when setting Injection Point to anything else than "After Post Process" in "WeaponPass" GameObject "Custom Pass Volume" component

  1. Resolution Note:

    This issue happens because you're using the injection point After Post Process to render an object with dynamic resolution enabled.
    When dynamic resolution is enabled, both color and depth are scaled by a certain factor until the post-processes. After that (in the after post-process injection point), the color buffer is the same size as the screen.

    This causes the depth and color buffer to not have the same size when you render objects after post-process, which causes the issue you reported in this bug. Unfortunately on our side, we can't change that as it would require us to patch the depth buffer so that it's the same size as the color buffer and all users would end up paying the cost of this.

    What you can do though is allocate a depth buffer that is not scaled by dynamic resolution to render your object in the custom pass like this:
    ```
    depthBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.R32_UInt, useDynamicScale: false, name: "CustomPassDepthBuffer", depthBufferBits: DepthBits.Depth32);
    ```
    and use it instead of the camera depth buffer.

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.