Enable Dynamic Resolution on PC: issues on 5.6 with bConstrainAspectRatio cameras (black borders)

Hello guys

We saw this post some weeks ago and we decided to backport 5.8 changes to enable dynamic resolution on PC on 5.6:

[Content removed]

We noticed that if we want to use the Upper Bound HZB reallocation optimization without issues we need to port more changesets than the ones reported in the post.

We have ported the following changesets:

  • CL 48870621 Enable Dynamic Resolution support for PC RHIs DX12 and Vulkan
  • CL 48822173 Keep HZB texture resolution at the Upper Bound views size (View.UpperBoundViewRect) in order to avoid the RT reallocation when dynamic resolution is enabled
  • CL 48868636 Add missing View.UpperBoundViewRect initialization in case of r.Test.ViewRectOffset 1 and CustomRenderPasses
  • CL 48964853 Missing TopLeftShift correction for UpperBoundViewRect when preparing the View
  • CL 52154255 Fix HZB ViewRect extending beyond view depth in split-screen
  • Cl 57782826 Fixed Nanite LOD scaling regression

The dynamic resolution works well but but it does not work correctly when using cameras with constrain aspect ratios (black borders).

It looks like there is a pending offset correction.

Could you please help us solve the problem?

We think we missed some changesets.

Thanks

[Attachment Removed]

Hello guys

I think I found the bug and a potential fix.

The bug is in CL 48964853 https://github.com/EpicGames/UnrealEngine/commit/f23153a7ad72b37785970cf6be7a2e1d5422e639

Views[i].UpperBoundViewRect -= TopLeftShiftIt should be

Views[i].UpperBoundViewRect.Min = Views[i].ViewRect.Min;This change fixes the issue with constrained aspect ratio cameras.

I could not test this fix in split screen though. We don’t use split screen in our title.

Please let me know what you think.

Thanks

[Attachment Removed]

Hi there!

I think you might need 53528049 and 53545738 as well. Even with those it seems your finding is a legitimate problem, and will need a fix, without testing but looking at the code I think with this version that keep the size should work:

  for (int32 i = 0; i < Views.Num(); i++)
  {
      Views[i].ViewRect -= TopLeftShift;
       Views[i].UpperBoundViewRect = FIntRect(Views[i].ViewRect.Min, Views[i].ViewRect.Min + Views[i].UpperBoundViewRect.Size());
  }

If that works for your case of cameras with constrain aspect ratios (black borders), I will submit it for a 5.8.4 patch. Proper resizing would be in 5.9/6.0.

Thanks!

Daniele

[Attachment Removed]

Hi [mention removed]​

I integrated 53528049 and 53545738 and used your fix and it works like a charm.

Thanks

[Attachment Removed]