0
\$\begingroup\$

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:

1. 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.

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

3. 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.

\$\endgroup\$
6
  • \$\begingroup\$ MSAA is hardware based, maybe your device doesn't support it. And I'm 90% sure forward rebdering isn't new, because it's basicammy the default type of rendering. \$\endgroup\$
    – Bálint
    Dec 7, 2016 at 13:32
  • \$\begingroup\$ The device supports MSAA (as do most GPUs since at least 2009). UE4 however was built from scratch around deferred shading (unlike Unity for instance which has had both forward and deferred for years or UE3 which was forward). Forward shading is indeed new in UE4 since 4.13 as beta and 4.14 officially. \$\endgroup\$ Dec 7, 2016 at 13:38
  • \$\begingroup\$ Why do you want to use forward rendering? It's technically slower. There's a checkbox in the developer menu, something like "enable multi-sampling". Try checking that. \$\endgroup\$
    – Bálint
    Dec 7, 2016 at 13:41
  • \$\begingroup\$ forward rendering is not slower than deferred by default. Deferred is only faster in the long run iff you have multiple realtime lights. Otherwise forward rendering tends to be faster (no gbuffer overhead) . Also forward rendering enables hardware msaa for free; Deferred needs an extra pass for screen space approaches to aa. This makes forward the current best choice for VR applications, which is what I'm doing. This is why UE introduced the forward path as a "new" feature in 4.14. \$\endgroup\$ Dec 7, 2016 at 14:04
  • \$\begingroup\$ @Bálint Unreal's forward renderer is new, it was added in 4.14, primarily for VR rendering. \$\endgroup\$ Dec 7, 2016 at 15:40

1 Answer 1

0
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ I'd like to know who down voted this and for what reason. The question is legitimate, and so is the answer. And the answer is the result of a lengthy back and forth trying things out with someone who actually works on the engine: forums.oculus.com/community/discussion/comment/… \$\endgroup\$ Jan 4, 2017 at 18:40
  • \$\begingroup\$ I'd like to know who downvoted this and why. \$\endgroup\$ Jan 5, 2017 at 18:56
  • \$\begingroup\$ Whomever downvoted this is a troll or an ignorant, so pay no attention to it. \$\endgroup\$ Jan 19, 2017 at 0:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .