Code Monkey home page Code Monkey logo

openvr-dynamic-resolution's Introduction

OpenVR Dynamic Resolution

Windows build testing

OpenVR app that dynamically adjusts the HMD's resolution to the GPU frametime, CPU frametime and VRAM.

This allows you to always have the maximum resolution your GPU can handle while hitting your target FPS (without reprojecting). Useful for games in which GPU requirement varies a lot (e.g. VRChat).

This is not the same as SteamVR's Auto Resolution, which seems to be using some benchmarking approach that does not work for the same as OVRDR.

Pro tip: if you want a higher resolution (for supersampling), you can lower your HMD's framerate to increase the target frametime.

Check out WorkingGames.md for a list of working and non-working games.

Installation/Using It

Make sure SteamVR's Render Resolution is set to Custom

  • Download the latest release
  • Extract the .zip
  • Launch OpenVR-Dynamic-Resolution.exe

Settings Descriptions

Settings are found in the settings.ini file. Do not rename that file. It should be located in the same folder as your executable file (OpenVR-Dynamic-Resolution.exe).

  • autoStart: (0 = disabled, 1 = enabled) Enabling it will launch the program with SteamVR automatically.

  • minimizeOnStart: (0 = show, 1 = minimize, 2 = hide) Will automatically minimize or hide the window on launch. If set to 2 (hide), you won't be able to exit the program manually, but it will automatically exit with SteamVR.

  • initialRes: The resolution the program sets your HMD's resolution when starting. Also the resolution that is targeted in vramOnlyMode.

  • minRes: The minimum value the program will be allowed to set your HMD's resolution to.

  • maxRes: The maximum value the program will be allowed to set your HMD's resolution to.

  • dataPullDelayMs: The time in milliseconds (1000ms = 1s) the program waits to pull and display new information. Adjust dataAverageSamples accordingly.

  • resChangeDelayMs: The delay in milliseconds (1000ms = 1s) between each resolution change. Lowering it will make the resolution change more responsive, but will cause more stuttering from resolution changes.

  • minCpuTimeThreshold: Don't increase resolution when CPU time in milliseconds is below this value. Useful to avoid the resolution increasing in the SteamVR void or during loading screens. Also see resetOnThreshold.

  • resIncreaseMin: How many static % to increase resolution when we have GPU or/and VRAM headroom.

  • resDecreaseMin: How many static % to decrease resolution when GPU frametime or/and VRAM usage is too high.

  • resIncreaseScale: How much to increase resolution depending on GPU frametime headroom.

  • resDecreaseScale: How much to decrease resolution depending on GPU frametime excess.

  • resIncreaseThreshold: Percentage of the target frametime at which the program will stop increase resolution

  • resDecreaseThreshold: Percentage of the target frametime at which the program will stop decreasing resolution

  • dataAverageSamples: Number of samples to use for the average GPU time. Depends on dataPullDelayMs.

  • resetOnThreshold: (0 = disabled, 1 = enabled) Enabling will reset the resolution to initialRes whenever minCpuTimeThreshold is met. Useful if you wanna go from playing a supported game to an unsuported games without having to reset your resolution/the program/SteamVR.

  • alwaysReproject: (0 = disabled, 1 = enabled) Enabling will double the target frametime, so if you're at a target FPS of 120, it'll target 60. Useful if you have a bad CPU but good GPU.

  • vramTarget: The target VRAM usage in percents. Once your VRAM usage exceeds this amount, the resolution will stop increasing.

  • vramLimit: The maximum VRAM usage in percents. Once your VRAM usage exceeds this amount, the resolution will start decreasing.

  • vramMonitorEnabled: (0 = disabled, 1 = enabled) If enabled, vram specific features will be enabled, otherwise it is assumed that free vram is always available.

  • vramOnlyMode: (0 = disabled, 1 = enabled) Only adjust resolution based off VRAM; ignore GPU and CPU frametimes. Will always stay at initialRes or lower (if VRAM limit is reached).

  • preferReprojection: (0 = disabled, 1 = enabled) If enabled, the GPU target frametime will double as soon as the CPU frametime is over the target frametime; else, the CPU frametime needs to be 2 times greater than the target frametime for the GPU target frametime to double.

  • ignoreCpuTime: (0 = disabled, 1 = enabled) Don't use the CPU frametime to adjust resolution.

  • disabledApps: Space-delimited list of OpenVR application keys that should be ignored for resolution adjustment. Steam games use the format steam.app.APPID, e.g. steam.app.438100 for VRChat and steam.app.620980 for Beat Saber.

Building from source

We assume that you already have Git and CMake installed. To build the project, run:

git clone --recursive https://github.com/Louka3000/OpenVR-Dynamic-Resolution.git
cd OpenVR-Dynamic-Resolution
cmake -B build
cmake --build build --config Release

You can then execute the newly built binary by running:

.\build\Release\OpenVR-Dynamic-Resolution.exe

Licensing

BSD 3-Clause License

This work is based on SlimeVR-Feeder-App which is licensed under the BSD 3-Clause License. We use the OpenVR library which is also available under the BSD 3-Clause License. Additionally, we use simpleini which is available the MIT License and the fmt library which is available under a Boost-like license.

openvr-dynamic-resolution's People

Contributors

crimson-foxgithub avatar erimelowo avatar imurx avatar kruemmelbande avatar lemire avatar williammck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

openvr-dynamic-resolution's Issues

VRChat doesn't work with OpenVR Dynamic Resolution

The first game I tested with this plugin was VRChat. Using fpsVR's benchmarking tools, the resolution didn't decrease or increase a single time the entire session. Even going from a less demanding world solo to Test Pilots pubs of 20 returned zero difference in resolution, and GPU frametimes also indicated nothing was happening. At 90Hz, frametimes tended to hover around 16ms instead of 11 or 22.5.

P.S. using minGpuTimeThreshold to avoid changing resolution during loading screens actually doesn't work because games use the GPU to load in assets. Framerates can dip as low as half your normal refresh rate during loading screens.

Support Linux

Support building from Linux, and using the program on Linux.

Be able to launch without window

Either no window, or to tray, or minimized.
Useful so you don’t have to minimize the window everytime, especially when it starts with SteamVR.

VRAM only mode

Hi, it would be amazing to be able to disable the resolution scaling based on frametimes and only enable VRAM monitoring.

In VRChat often lowering the resolution gives no extra frames (and they are often even below half the target), but it not uncommon for the VRAM to be completely full, which can be fixed by the dynamic resolution.

Thanks!

EnabledApps Feature

Adding a feature where it would only be enabled with the listed apps e.g vrchat only and pause during everything else or set list.

It would be helpful instead of going one by one grabbing steam app ids.

Target gpu frame time should have a manual target, VRC loading screen and purple frame times.

I've always been ok with a little bit of latency and for lower end cards like my 2080 super even running this makes my resolution drop to 60 percent me knowing I can have it at 150% and have an enjoyable experience (even with the latency I'd rather not see pixels)

VRC loading screen does not load anything showing 1.5-2ms gpu latency and bumping up my resolution and killing me on world entry.

Purple frame times or missed frames count also as 0 latency? and proceed to kill me if Iag out making the lag that much worse

Also any gpu stuttering has lows of 1.5ms causing resolution increase post lag spike.
(Lowering resolution durring constant stuttering until frame times are stable could fix this)

Make resolution as low as possible during purple frame times and set loading screens to <110% to increase quality of life!

Also if CPU frame times can be accounted for (optional) that'd be great! (with a target and a min)

Utilize OpenVR's frame buffer

We don't have to refresh ever 10ms to get every frame. OpenVR keeps a buffer of a couple dozen frames. The program should use every frame that it didn't use between each refresh to get more accurate information.

OpenVR Dynamic Resolution does not work with certain games

I decided to test Propagation VR with your application running, and it didn't change the resolution at all, even when increasing graphics settings to the maximum. UE4 handles resolution scaling stuffs a little differently, and I've noticed that not a single working title listed in WorkingGames.md as of typing this runs on Unreal Engine: every single game listed uses Unity in some form.

Steam Link

Will this effect quality when using the new steam link app released now on Quest?

Just wanted to see your thoughts and if there can be any integrations made to streamline the process.

Only increase resolution, if there is vram available

Currently, in lighter to render scenes, it will increase my resolution, until i hit the vram limit, at which point, my framerate drops to about 20, and then the resolution drops back to the minimum.

I think it would be helpful, if it was possible to capture vram usage, and if there is lets say more than 95% vram usage, the resolution just does not increase, no matter how little the gpu frametime is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.