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
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
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
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.