obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
769 stars 217 forks source link

Increased maximum width and height #395

Closed fungiboletus closed 1 year ago

fungiboletus commented 1 year ago

Description

The maximum width and height are currently 4096 pixels, and this pull request double the maximum to 8192 pixels.

Motivation and Context

This change is required to support higher resolutions, such as 7680x4320 (8K).

How Has This Been Tested?

I compiled and run OBS on my laptop. I tested various webpages at low and high resolutions, including some webgl demos.

Types of changes

Checklist:

Feel free to close or reject my pull-request.

RytoEX commented 1 year ago

Please actually test these changes to verify that OBS will work.

WizardCM commented 1 year ago

I have previously been hesitant about merging this change in particular as the supported value depends on the user's hardware and our graphics context (eg. D3D feature level).

As it stands, as we no longer support Windows 7 or 8, I'm more comfortable with this change.

fungiboletus commented 1 year ago

Alright, I tested and it works on my machine 🥳

My machine is a windows 11 arm64 Parallel Desktop VM running on a Macbook pro M1. I compiled the amd64 version of OBS. It's a bit exotic and weird and it worked very well. I also successfully tested some WebGL demos at 8K with descent FPS.

image

RytoEX commented 1 year ago

As it stands, as we no longer support Windows 7 or 8, I'm more comfortable with this change.

Is that because browser hardware acceleration did not work on Windows 7, or some other reason? I wouldn't mind someone testing this on macOS and Linux, but I'm not opposed to this change in general. If macOS and Linux contributors think it's safe enough to land first and get wider testing later, I'm also not opposed.

Just for reference, the support for 8K textures depends on the DirectX hardware support or OpenGL implementation. In D3D 10.1 hardware (which OBS supposedly still supports, though Windows 10 only requires DX9 hardware, while Windows 11 requires DX12 hardware), the maximum texture dimension is 8192, so this would be fine. In OpenGL, the maximum texture dimension is left to the implementation. Though GL_MAX_TEXTURE_SIZE below 8192 is exceedingly rare, they do still exist. For example, see the difference between these reports from August 2015 and August 2022, where the incidence of GL_MAX_TEXTURE_SIZE of below 8192 dropped from about 11% to below 1%:

fungiboletus commented 1 year ago

Perhaps we could fetch the value of GL_MAX_TEXTURE_SIZE once when loading the user interface and then use the lowest between it and 8192.

I will try to test on Mac OS, and perhaps some Linux distribution if I have enough time.

fungiboletus commented 1 year ago

image

I tested on macOs 13.2.1 (arm64) and it works well.

derrod commented 1 year ago

Basically all hardware still supported by OBS should support at least 16K x 16K texture sizes. So this PR seems fine to me.

RytoEX commented 1 year ago

Basically all hardware still supported by OBS should support at least 16K x 16K texture sizes. So this PR seems fine to me.

Debatable, as I've pointed out before that DX 10.1 supports only 8K, and we supposedly still support DX 10.1 hardware on Windows 10. That being the case, bumping to 8K, as this PR does, is fine.