The screen is offset in some cases when switching to exclusive fullscreen mode with 16:9 resolutions.

(This is a translation of a [Japanese [Content removed] by Tanaka Takashi.)

Thank you for your continued support.

In our project, when running in exclusive fullscreen mode and specifying a resolution with a different aspect ratio than the output monitor, I use letterboxing or pillarboxing to preserve the requested aspect ratio while filling the screen.

When I directly specified the target resolution, the rendered image was offset toward the top-left of the screen as shown in the attached image. As a workaround, I now calculate and apply a resolution that matches the output monitor’s aspect ratio, then adjust the rendered image’s aspect ratio afterward.

This works as expected in most cases, but with some resolutions, the image does not fill the screen even though a 16:9 resolution is specified.

For example, when outputting to a 3440×1440 (UWQHD) monitor while rendering at 3840×2160, we first calculate a 16:9 resolution based on 3440, resulting in 3440×1935, and pass this as the screen resolution. In this case, the image is not displayed fullscreen.

Could you please advise on the cause of this behavior and any possible solutions?

Thank you.

[Attachment Removed]

再現手順
1) Create any UE5 project and launch it in Standalone mode.

2) Move the standalone game window to a 4K monitor.

3) Enter a non-standard 16:9 resolution using a command such as:

r.setres 3440x1935f

[Attachment Removed]

Hi there,

The resolution that you pass into SetRes should not only be at your 16:9 aspect ratio, but should also be a supported resolution. Without this, the view rect will not be scaled as expected, and you will end up with letterboxing and pillarboxing as observed.

You can look to the implementations of RHIGetAvailableResolutions, or UKismetSystemLibrary::GetSupportedFullscreenResolutions if you are in blueprints.

Thanks,

Hayden

[Attachment Removed]

[mention removed]​

(This is a translation of a Japanese post by Tanaka Takashi.)

Thank you very much for your reply.

I would like to ask additional questions:

(1) Is it possible to obtain a list of resolutions supported by the engine? Alternatively, if there is any documentation that lists the supported resolutions, could you please share it with me?

(2) Is it possible to support additional resolutions on a per-project basis?

(3) Finally, regarding exclusive fullscreen mode, since the engine does not support resolutions with different aspect ratios, is it correct to understand that the aspect ratio must always remain the same?

Thank you in advance.

[Attachment Removed]

[mention removed]​

(This is a translation of a Japanese post by Tanaka Takashi.)

Thank you very much for your reply.

I have confirmed that I can retrieve the list of resolution candidates using Get Supported Fullscreen Resolutions.

However, regarding these resolution candidates, they appear to be calculated based on the resolution of the display that is set as the main display. As a result, in an environment where an FHD display is configured as the main display, when attempting to output to a 4K monitor, resolutions larger than FHD are not retrieved correctly, and the full 4K resolution cannot be utilized.

In addition, when a UW-QHD display is selected as the main display and the application is shown on a separate 4K display, there is an issue where resolutions that are not actually supported by that display can be selected.

Due to these issues, I would like to retrieve the list of supported resolutions based on the display on which the application is currently being shown. Is this possible?

Thank you.

[Attachment Removed]

Hi there,

To answer your questions:

  1. This will be determined by your display adapter, i.e. the monitor that is connected. You can easily obtain this with the Get Supported Fullscreen Resolutions Blueprint node. Under the hood this will call the relevant RHI’s implementation of RHIGetAvailableResolutions. For example, if you are using DX12, you can look into this further in FD3D12DynamicRHI::RHIGetAvailableResolutions.
  2. As I mentioned in the first point, these resolutions are tied to the display adapter rather than anything defined in the project. I would recommend looking into the functions mentioned above to get a deeper understanding on how these are populated under the hood. You could of course further filter the array that is returned by any parameters you define, for example, custom minimum or maximum resolutions such that you choose to ignore certain entries from the supported resolutions array.
  3. I believe you should still be able to use SetRes to set resolutions of differing aspect ratios, and in my testing with an ultrawide monitor, the engine should scale the viewport without letterboxing or pillarboxing. If you did want to maintain an aspect ratio, that can still be done on your camera’s settings.

Thanks,

Hayden

[Attachment Removed]

Hi there,

It is definitely possible to achieve what you are after, but there isn’t anything nicely pre-exposed in the engine that does this, the likes of the BP exposed Get Supported Fullscreen Resolutions.

Here is some useful code in the engine to get you started, but note that this uses Windows specifc code,

At a high level, you will first want to iterate over all of your monitors with EnumDisplayDevices, and then for each monitor, use EnumDisplaySettings to iterate over all supported display modes. EnumDisplayDevices will provide you with Display Devices, which you can pass into EnumDisplaySettings to pull out the supported resolution with the DEVMODE.dmPelsWidth and DEVMODE.dmPelsHeight parameters.

As a starting point, I would recommend looking into WindowsApplication::GetMaxResolutionForDisplay and WindowsApplication::GetMonitorsInfo to see the existing usage of this code in the engine. The relevant macros and types are defined in WinUser.h.

Thanks,

Hayden

[Attachment Removed]

[mention removed]​

(This is a translation of a Japanese post by Tanaka Takashi.)

Thank you very much for your reply.

Thanks to the answer you provided me with, I was able to implement the functionality I need. So I’ll mark your answer as the best answer.

Please close this thread.

Thank you for your support!

[Attachment Removed]