How can I change the MSAA sample count for GearVR?

After a long discussion in the Oculus forums

I was told that the current way to change the MSAA sample count for GearVR is to modify OpenGLRenderTarget.cpp: line 154:

if (bUsingMobileOnChipMSAA)
		{
			// 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 in my tests, the codepath starting at line 134 is not even executed when running on my device (Samsung Galaxy S6). I tested this by adding a few logs starting at line 135, recompiling the engine, packaging for Android ETC2 and deploying to the device.

What’s more, line 157 is glFramebufferTextureMultisampleMultiviewOVR which to me implies this path would only execute if I had multiview enabled, which I don’t.

I just want to increase the MSAA from 2 to 4.

Does anyone know where in the codebase should I do this?

You need to change the 2’s in the calls to glFramebufferTexture2DMultisampleEXT and glRenderbufferStorageMultisampleEXT in that same file for the non-multiview case.

For 4.15 I’ve cleaned this code up so that Android will use the same r.MobileMSAA=1, 2 or 4 etc console variable we use on iOS and the r.OnChipMSAA console variable will go away.

  • Jack