cancel
Showing results for 
Search instead for 
Did you mean: 

Toggle antiAliasing

hexagon99
Honored Guest
I would like to turn AA on for some levels and off for others to help with Unity 5 performance. However, if I attach a script with the below code, it renders in mono with no head tracking. Seems like it disables "Virtual Reality Supported". Is this possible to toggle at all?

void Start() {
QualitySettings.antiAliasing = 0;
}
13 REPLIES 13

owenwp
Expert Protege
Because the antialiasing must be applied to the oculus-provided render targets, not the back buffer, changing its value requires those render targets to be reallocated. If there is a way to toggle it, it would probably be in the oculus sdk somewhere, not in unity. It might be one of those settable hardware capability flags.

From what I recall, the oculus SDK forces the default MSAA off when it starts up, then does its own thing.

hexagon99
Honored Guest
Can anyone from Oculus let me know if this can be changed within the SDK?

As far as I know, the Oculus SDK no longer controls AA since unity has added integrated VR support.

vrdaveb
Oculus Staff
QualitySettings.antiAliasing is the right setting to use. We've reworked it to apply to Unity's eye buffers instead of the backbuffer when VR is active. We don't require any particular value and it should work fine to set it like you're doing. What version of Unity are you on? I just tested 5.2.2p2 on the Rift and Gear VR and it worked properly.

hexagon99
Honored Guest
Thanks Dave, I am on 5.2.2 without patches. I will get the latest patch tonight and confirm that it works.

hexagon99
Honored Guest
Hi Dave, I have tested it out now and it is still not working. I am now on 5.2.2p2 and it is disabling VR support it seems like. Any advice? Does it matter that I am calling the quality settings with Start?

hexagon99
Honored Guest
I should mention that I am testing with a Note 4, does that matter at all?

hexagon99
Honored Guest
I can confirm that even if I change quality settings later in the scene it still goes to 2D. Should I report a bug to Unity?

Anonymous
Not applicable
Does the same thing happen if you set it in Awake()?

How about if you do this after: UnityEngine.VR.VRSettings.enabled = true;

hexagon99
Honored Guest
"gconvergen" wrote:
Does the same thing happen if you set it in Awake()?

How about if you do this after: UnityEngine.VR.VRSettings.enabled = true;


Thanks for the tips. But neither of those work. It is still in 2d with no head tracking.