Anti-Aliasing for Mobile VR

Anti-Aliasing effects don’t seem to be working on mobile. On the PC preview, TAA looks the best yet only displays one side of the screen on the phone. FXAA looks bad on both PC and on the phone. No anti-aliasing is just as awful. Either way, I feel like I’m rubbing a cactus into my eyes.

I saw that it’s possible to get the AA looking nice, as in 4.9 there’s this video of MSAA working for GearVR. I’m making an environment for GoogleVR as my project will be using Daydream. However, I can’t shake this horrible AA problem, which isn’t there in any other VR app I’ve tested on my phone. What is this madness and how can I fix it?

Video with MSAA - Gear VR UE4 49Pr MSAATest - YouTube

Look at how horrible the AA is on mobile. It’s death on the eyes. I put links underneath each picture so you too, can experience it at a bigger size.

http://puu.sh/pJfJK/8df8af553a.jpg

http://puu.sh/pJfJK/8df8af553a.jpg

http://puu.sh/pJfC5/322170d7a7.jpg

http://puu.sh/pJfC5/322170d7a7.jpg

http://puu.sh/pJfEg/364ddaebb3.jpg

http://puu.sh/pJfEg/364ddaebb3.jpg

This project is just a test in prep for my FYP at University which will begin later this year, so any help is massively appreciated.

Are you testing on a GearVR device or some other device? In the limited GearVR work I’ve done I’ve been able to get decent anti-aliasing, but if I’m remembering correctly (a big if), it’s adaptive meaning if your frame rate drops too low it will automatically turn off anti-aliasing to try and save the frame rate. So if your game isn’t optimized very well you may never see anti-aliasing turned on. To test my theory, you might try creating a new empty project using the “Mobile”, “Scalable 3D/2D”, “No Starter Content” options, adding just a simple cube, and running that on the device to see if you still have aliasing problems.

FWIW, it actually does look like some level of anti-aliasing is on in your screenshots. It’s not perfect because of the high contrast and shallow angles of some lines, but it doesn’t look completely aliased. If you turn AA off at runtime via a blueprint do you see a difference?

The AA is exactly the same in an empty scene with some basic primitives in it. Tried with both Maximum Quality and Scalable 3D/2D. Still got the same issue :frowning:

It gets even worse when NormalMaps are added into the mix.

I had to add r.MobileOnChipMSAA=1 in Android device profiles to get AA working on my builds.

Windows > Developer Tools > Device Profiles > Android > Wrench Icon for CVars
Putting it on the Android profile will add it to every Android device. You may want to put it on some child profiles like Android_High or Android_Adreno etc - I just put it on the base profile so I could make sure it was getting applied to my phone while trying to figure this out.

One thing to note is that I needed to increase my r.MobileContentScaleFactor since turning on MSAA resulted in everything being output at 720p instead of 1080p. I have a text actor blueprint in my level outptting “GetViewportSize” and when i turned MSAA on it went down to 1280x720.

This was with r.MobileContentScaleFactor set to 1.5 in the Device Profile. I had to put it at 2 to get back to 1920x1080. (this is on an old Note 3) If i remove the MSAA settings 1.5 gives me 1080p and 2 puts me back to 720p maybe because it’s too high.

I guess that maybe makes sense with regards to what MSAA does. You have to increase the canvas resolution because its going to get sampled down? Or it’s just some weirdness? But that also might be why when people do get AA working they report that it looks ugly because the resolution is now lower.

Either way having the text actor displaying the viewport size really helped since i could tell straight away the build was at the wrong resolution without having to guess - and after running a billion builds at different settings you start to distrust your eyes/sanity. Adjusting the scale factor and rebuilding generally fixed things.

Anyway this thread is a bit old but I thought someone might find this helpful. Making sure I was outputting the right resolution and turning on AA really made the VR experience a lot better.

I also have no AA turned on in the editor rendering settings. And this was in an ATC build. UE 4.12.

There is also r.MobileMSAA but that didn’t appear to do anything regardless of Temporal AA being turned on in the editor settings. But i’ve seen that referred to in posts about iOS so maybe that’s just for iDevices?

r.MobileOnChipMSAA=1 worked for my Galaxy S7, r.MobileMSAA=1 seems only work for iOS as you pointed out also, it actually crashes my app.
The scalefactor is also a key, since by default UE4 is 720P, you need to make sure your device scales correctly. ScaleFactor 2.0 ~ 2560*1440 for example.

I’m currently having a problem with r.MobileOnChipMSAA, whether I set it to 0 or 1 it doesn’t seem to make any difference. This is with r.MobileContentScaleFactor=0, which per the daydream docs should mean native resolution. Trying it next with r.MobileContentScaleFactor=1 just to see if it changes anything. One note is I’m using ATSC so I may try ATC next as well. Frustrating & slow to trouble shoot this stuff.

I assume MSAA should be pretty obvious when it’s working but would be nice if there was a way to check as well. I’ve been doing screenshot comparisons for now.