iOS Quality Settings through the Device Profile Manager

So I’ve started making a game for iOS in UE4.6 and I noticed that the quality is extremely low when I build it on my iPhone 6, so I did some research and found out that I need to add this line:

r.MobileContentScaleFactor=2

as a parameter to the DeviceProfiles INI. Since I’m in the latest engine, that has a GUI, so I proceeded to go to the Device Profile Manager and scroll down to iPhone 6 in the device list. There, I clicked the edit CVars button and added r.MobileContentScaleFactor=2 to the Rendering variables, closed the window, and proceeded to launch my project. However, when the app ran on my phone again, the quality was unchanged.

I went into the Saved folder in my project folder and to the engine/config and opened up basedeviceprofiles.ini and found this:

[ DeviceProfile]
DeviceType=IOS
BaseProfileName=IOS
+CVars=r.BloomQuality=1
+CVars=r.DepthOfFieldQuality=1
+CVars=r.LightShaftQuality=1

Where’s the +CVars=r.MobileContentScaleFactor=2? If I add it in manually there and relaunch, this file just gets overwritten again and the line disappears.

What am I doing wrong?

Well, I have the same problem with iphone 6. Still looking for an answer.

So BaseDeviceProfiles.ini is the defaults file and shouldn’t be updated. If you modified the settings, there should be a file in the Game/Config folder called DefaultDeviceProfiles.ini which should have your change in it. It will look something similar to the one in TappyChicken/Config/DefaultDeviceProfiles.ini.

Because of the way cvars work, the new value may not be getting written until you exit from the editor. Try exiting the editor after the change and re-launching it to see if that fixes the problem. If so, I’ll see if we can get a bug added as that one should get updated since it is only affecting a device profile and not the main cvar in the editor.

-Pete

Ok but the render scale on the iPhone 6+ is a lot more complicated than just 2.0. All other iOS devices are either 1.0 (non-retina) or 2.0 (retina). But to get pixel for pixel rendering on the 6+ you have to jump through some hoops to calculate the exact number. And the number is different if the user has zoom mode turned on or off.

Why doesn’t the engine default to a pixel for pixel rendering mode?

Can that value be set programmatically?

We have it different for different devices because we want users to have a decent experience out of the box without having to do any specific optimizations or such. If you set the mobile scale factor to 0, it will be pixel for pixel.

-Pete

Is there documentation on that somewhere? I searched but couldn’t find it. So in the above it says to set r.MobileContentScaleFactor=2 but you’re saying to set it to zero?

To get the iPhone 6 to be pixel for pixel in Objective-C I had to do this:

    if([[UIScreen mainScreen] respondsToSelector:@selector(nativeScale)]) {
        scaleFactor = [[UIScreen mainScreen] nativeScale];
        nativeBounds = [[UIScreen mainScreen] nativeBounds];
        width = nativeBounds.size.width / scaleFactor;
        height = nativeBounds.size.height / scaleFactor;
    else if([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
        scaleFactor = [[UIScreen mainScreen] scale];
        width = screenRect.size.width;
        height = screenRect.size.height;
        
    }
    
    glView = [[EAGLView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
    glView.contentScaleFactor = scaleFactor;

If you set it to zero, it will ask the screen for the nativeScale and utilize that as the fallback since 0 is not a valid scale. The code you have above is similar to what we do in the case where r.MobileContentScaleFactor=0.

-Pete

Oh that makes sense. Great. Is this documented somewhere? What each of those r. settings do and what the possible values are for them? There are a lot of things to tweak there and I want to tune the performance on my app as much as possible per device.

Also… I’m still seeing the table and chairs very chunky. So far I’ve only set it on the iPhone6plus profile. What connects that profile to my actual device type? From what I can tell it’s just a profile name.