Question about Screen percentage and Resolution quality
Is there a way to set ResolutionQuality (sg.ResolutionQuality) at runtime without the ScreenPercentage automatically being set to 100?
I'm using scalability auto which will set both ResolutionQuality and ScreenPercentage based on the GPU benchmark value. For Oculus I'm using the adaptive pixel density feature, but for SteamVR I want to be able to modify ResolutionQuality at runtime based on framerate (since ScreenPercentage can't be changed without a hiccup).
My current workaround is that if I run my "scalability auto" and that sets the ScreenPercentage to 120, I can then use the "Get ScreenPercentage" in my level blueprint and then run "r.ScreenPercentage" with the value I got from "Get ScreenPercentage" and after that I can change the ResolutionQuality without the ScreenPercentage being changed.
asked Dec 12 '17 at 03:40 PM in VR
I did some research on this but forgot to answer my own question, sorry.
But here goes: I thought sg.ResolutionQuality was an engine setting that would somehow change the quality of the rendering, but it turns out that the "sg" part stands for scalability group and it's a value that you have to define in your DefaultScalability.ini.
From what I gather, you can define up to four scalability groups for sg.ResolutionQuality in the ini file. If you add more they will be ignored.
As an example, adding this row in DefaultScalability.ini would define four groups: PerfIndexThresholds_ResolutionQuality="GPU 150 200 250 300"
The groups are based on the GPU value that you acquire by running the console command "scalability auto".
Adding this row will set a value for each of the groups above: PerfIndexValues_ResolutionQuality="50 65 75 85 100"
There are five values instead of four, because the first value is for when the GPU value is lower than the first defined group (<150 in the case above).
If you add the two lines above to your DefaultScalability.ini and run the command "scalability auto" the engine will set a sg.ResolutionQuality value based on your GPU performance. Let's say you have a GPU that scores between 150 and 200, the engine will then set sg.ResolutionQuality 65. The resolutionquality value directly corresponds to r.ScreenPercentage, so "sg.ResolutionQuality 65" will automatically set "r.ScreenPercentage" to 65.
The problem I ran into was that I tried to set resolutionquality values that were higher than 100. In VR you tend to want to use r.ScreenPercentage values between 100 and 150, and you definitely want to avoid values below 100. But it turns out that setting a resolutionquality value above 100 will set the r.ScreenPercentage value to 100.
The workaround for me was to define the groups as follows: PerfIndexThresholds_ResolutionQuality="GPU 150 200 250 300" PerfIndexValues_ResolutionQuality="100 115 130 140 150"
Then I would pause the game on a thread that was set to "tickable while paused" and run the "scalability auto" command (pausing before running scalability auto seems to give more predictable values).
Then I would get the "Current Scale Value" from GetGameUserSettings ---> GetResolutionScaleInformation and convert that from float to string and append it to r.ScreenPercentage and feed it into Execute Console Command. This results in the ScreenPercentage value being set to the ResolutionQuality value defined in yout DefaultScalability.ini file.
There's still a hiccup each time you change the ScreenPercentage value, so you will not be able to set it dynamically based on performance.
I should mention that since sg.ResolutionQuality only affects r.ScreenPercentage (as far as I know), it's much simpler to just add "r.ScreenPercentage" with a value to one of your existing scalability groups that are set based on GPU in the DefaultScalability.ini.
I should also mention that you will need to restart the editor each time you change the DefaultScalability.ini file in order for your changes to come into effect.
answered Dec 16 '17 at 10:06 AM
You can use the Execute Console Command blueprint node to issue any console command, including sg.ResolutionQuality, at runtime:
answered Dec 16 '17 at 08:19 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here