Skip to main content
Up and Coming
June 19, 2015

Invalid antiAliasing value (must be 1,2,4 or 8)

This error pops up twice in the Console now. I'm sure I caused it by goofing with some setting, but I can't find where that might be.

The total error says:

Invalid antiAliasing value (must be 1,2,4 or 8)
UnityEngine.RenderTexture:set_antiAliasing(Int32)


If anyone has encountered this, could you please point me in the direction to fix it?
    This topic has been closed for replies.

    3 replies

    Inspiring
    June 19, 2015
    It's probably being set to 0, when it should be set to 1 (to turn off MSAA). Seems like Unity often changes whether "MSAA off" is 0 or 1. So if this is in your code, easy fix. If it's in the Oculus Unity scripts, maybe you can hack it, or at the very least double check that you're using the right version of the SDK for the right version of Unity. Otherwise, not sure what the issue would be.
    Titans of Space PLUS for Quest is now available on DrashVR.com
    wadamwAuthor
    Up and Coming
    June 24, 2015
    Thanks for the response drash

    It appears that at runtime, Unity changes the OVRManager's Eye Texture Antialisasing to nothing (the pulldown just goes blank). Double-clicking the error goes to line 639 in OVRDisplay:

    eyeTextures[eyeIndex].antiAliasing = (int)OVRManager.instance.eyeTextureAntiAliasing;


    Can't figure out who's changing the Eye Texture Antialiasing from 2 to null...any ideas on that?
    Inspiring
    June 24, 2015
    "wadamw" wrote:
    It appears that at runtime, Unity changes the OVRManager's Eye Texture Antialisasing to nothing (the pulldown just goes blank). Double-clicking the error goes to line 639 in OVRDisplay:

    eyeTextures[eyeIndex].antiAliasing = (int)OVRManager.instance.eyeTextureAntiAliasing;


    Can't figure out who's changing the Eye Texture Antialiasing from 2 to null...any ideas on that?

    OVRManager's eyeTextureAntiAliasing is not a nullable Enum, so it actually can't be null in the first place, so the reason you're seeing a blank value in the dropdown is because the actual value of this field is not defined in the OVRManager's RenderTextureAntiAliasing enum and so has no corresponding name. The value is probably mistakenly set to 0 (at runtime?), but 0 is not in this enum, so it will show up blank. 0 in this case also probably is no longer recognized by Unity and must be set to 1 instead, which is why you're seeing that error as it sets the RenderTexture's antiAliasing value to 0. 0 used to mean "no MSAA", and now 1 must be used instead.

    So the question is, why is OVRManager's eyeTextureAntiAliasing value set to 0 at runtime? What does your OVRManager say for eyeTextureAntiAliasing (at design time, not at runtime)? It kind of sounds like OVRManager has an old value serialized from when you were using an older SDK. If that's not it, then... .do you have more than one OVRManager in your scene? What happens if you explicitly change the OVRManager's eyeTextureAntiAliasing value and then try running it again?

    Hope that gets you closer!
    Titans of Space PLUS for Quest is now available on DrashVR.com