MSAA seems broken for GearVR in 4.14

I’m trying to use the new forward rendering with MSAA in GearVR, on a Galaxy S6. But there’s definitely no antialiasing going on. At all.

After a lot of time searching online and in the editor I found the following variables which potentially could be related to turning MSAA on:

Window > Developer Tools > Device Profiles > Android:

  • r.MSAACount
  • r.MSAACompositingSampleCount
  • r.DefaultFeature.Antialiasing
  • r.MobileOnChipMSAA
  • r.MobileMSAA
  • r.MobileContentScaleFactor

None of the above seem to make a difference if I change them from within the Device Profiles editor within UEd.

Edit > Project Settings > Engine > Rendering > Default Settings > Anti-Aliasing Method:. Setting it to MSAA does nothing.

I also tried setting all of the previous variables from within DefaultEngine.ini and nothing.

There’s got to be something I am overlooking. If anyone has any thoughts I’d really appreciate it.

bump. :frowning:

And btw, why did this get moved from bug reports? I had originally posted under question, but no one here ever replied and in the Unreal forums it was suggested to me that I move it to bug report here, since GearVR antialiasing should be on by default.

Pretty sad that these forums seem dead, since it would have been so easy for someone from Epic to just point me to where I need to look in the source. But oh well…

Turns out that:

  1. MSAA is enabled by default for mobile.
  2. The Forward renderer in 4.14 has nothing to do with mobile. It’s new only for desktop (i.e. HTC Vive and Rift).

As to how to check that MSAA is indeed enabled:

You can check when running on the device in the logcat by searching for:
LogHMD: Enabling r.MobileOnChipMSAA, previous value 0

You can also add a log (and recompile the engine) at OpenGLRenderTarget.cpp: line 201. You want to make sure you are hitting:
glFramebufferTexture2DMultisampleEXT

Since the else branch in this codepath would otherwise create a non multisampled FBO.

The MSAA sample count however, appears to be hardcoded to 2 somewhere else in the engine source.
After a long discussion in the Oculus forums I was told I could change the sample count (to have MSAA x4 for instance) at line 152:

`// TODO: Mali supports 4x with similar hit as 2x, should we do something smarter here? Hard coded to 2 everywhere else
			const uint32 SampleCount = 2;

But this codepath is not being executed when running on the device. So not sure where else the 2 might be hardcoded.

Hi there! Do I understand it correct and you managed to get the MSAA working?

I’m currently developing a cardboard app on a OP3T during my graduation project and got stuck on the same problem. I’ve read the few other discussions about this and tried over the past days much likely all variations of settings and approaches that I stumbled upon. It really drives me crazy because nothing seems to have any effect on the jagged edges. I’m more of an Artist-type and this troubleshooting is very frustrating, but switching the engine at the current point would be an immense setback.

I understand that cardboard is not the same as gearVR but, would you be so kind and tell me how you succeeded with the MSAA?

What are your final settings regarding forward-/deferred rendering; HDR on/off, Engine Version, etc.

And what about the stereo layeres mentioned in the other discussion on the occulus forum? I tried them and got the same result you described there.

Thank you!

Okay after going through everything again I got finally a significant better Image!

My fault was, that I edited the settings only via the DeviceProfiles Manager and the DefaultEngine.ini, not in the DefaultDeviceProfiles.ini that you have to create first.

I had to check and correct the settings between the builds twice everytime to ensure that they get applied. Not very intuitive and can’t be sure of my first testbuild-results.

I also tried some builds with the UE4.14.3 because in the newer version there is no r.MobileOnChipMSAA anymore, but with the same settings the app did not run on the device.
This is probably a problem with the GoogleVR settings referable to Cardboard/Daydream settings. But as I created my project in the newest version anyway, I will not further investigate this path.

My final settings that worked on my device (OnePlus3T):

UE4.15.1

HDR=true
r.DefaultFeature.AntiAliasing=3
r.MobileMSAA=2
r.MobileContentScaleFactor=1.5

Best result so far (I think 4xMSAA)

HDR=false
r.DefaultFeature.AntiAliasing=3
r.MobileMSAA=4
r.MobileContentScaleFactor=2.0

I am not 100% sure if the ContentScaleFactor really made a difference, can’t trust my eyes anymore, but the jagged edges on geometry are much better now!
The UMG parts and materials look also a bit better but are still jagged and flickering, but that works as intended if I understood the rendering pipeline correct and has to be solved elsewhere.

Maybe that helps someone, it was really pain! x)