Skip to main content
Up and Coming
July 26, 2013

Unity 4.2 supports anti-aliasing on render targets

Just noticed in the release notes that the recent Unity 4.2 release finally supports anti-aliasing on render targets!

Might be a big quality boost for demos running native resolution.. downloading now.
    This topic has been closed for replies.

    34 replies

    Inspiring
    August 16, 2013
    There should be a line at the top of OVRCamera that looks like:

    // #define MSAA_ENABLED

    you'll want to comment it out.

    As previously noted though, there are significant issues with it right now. In first law I've noticed tons of rendering errors that will need to be sorted out before I can enable it in the game.
    Twitter : @rje Web : rjevans.net Youtube : My Channel
    Up and Coming
    August 16, 2013
    "rje" wrote:
    There should be a line at the top of OVRCamera that looks like:

    // #define MSAA_ENABLED
    you'll want to comment it out.



    That line is actually from the old Ovrcamera.cs file from January- Make sure to get the new ones!..
    To be honest, I'm cool with ditching dynamic lights and shadows for proper msaa if this noticeably works..

    The baking in unity is plenty to work with in my case.

    AG
    Up and Coming
    August 16, 2013
    Just got it working -

    Here's a before and after.. (I can actually read my HUD now!!! :D)



    A round of drinks for Team Oculus please!

    AG
    August 18, 2013
    I'm getting this error after updating... any ideas?

    Assets/OVR/Scripts/OVRCamera.cs(112,39): error CS1061: Type `UnityEngine.RenderTexture' does not contain a definition for `antiAliasing' and no extension method `antiAliasing' of type `UnityEngine.RenderTexture' could be found (are you missing a using directive or an assembly reference?)



    // Use MSAA settings in QualitySettings for new RenderTexture
    CameraTexture.antiAliasing = QualitySettings.antiAliasing;
    }
    }
    Participant
    August 18, 2013
    "HeadTrip" wrote:
    I'm getting this error after updating... any ideas?

    Assets/OVR/Scripts/OVRCamera.cs(112,39): error CS1061: Type `UnityEngine.RenderTexture' does not contain a definition for `antiAliasing' and no extension method `antiAliasing' of type `UnityEngine.RenderTexture' could be found (are you missing a using directive or an assembly reference?)


    I got that using version 0.24 of the Oculus library before I updated Unity to 4.2. I assume you've updated the Oculus lib and have not updated Unity to 4.2.
    Inspiring
    August 18, 2013
    That looks great, antigravity! Are both screenshots taken at 1280x800?

    Wondering how you got it working -- I saw that the CameraTextureScale was supposed to draw its value from DistortionScale() but it seems to be commented out and doesn't work when uncommented. Did you go a different route?
    Titans of Space PLUS for Quest is now available on DrashVR.com
    Up and Coming
    August 18, 2013
    "HeadTrip" wrote:
    I'm getting this error after updating... any ideas?

    Assets/OVR/Scripts/OVRCamera.cs(112,39): error CS1061: Type `UnityEngine.RenderTexture' does not contain a definition for `antiAliasing' and no extension method `antiAliasing' of type `UnityEngine.RenderTexture' could be found (are you missing a using directive or an assembly reference?)



    // Use MSAA settings in QualitySettings for new RenderTexture
    CameraTexture.antiAliasing = QualitySettings.antiAliasing;
    }
    }



    Ya, you gotta upgrade unity to 4.2!

    best,
    AG
    Up and Coming
    August 18, 2013
    "drash" wrote:
    That looks great, antigravity! Are both screenshots taken at 1280x800?


    yep! well actually way less as it's a small crop of the 1280 corner.

    "drash" wrote:
    Wondering how you got it working -- I saw that the CameraTextureScale was supposed to draw its value from DistortionScale() but it seems to be commented out and doesn't work when uncommented. Did you go a different route?


    Hmm, make sure you're using the 0.2.4 SDK, axe your old cameras, bring in the new ones, and adjust line 41 of OVRCamera.cs

    "private float CameraTextureScale = 1.0f;"
    August 18, 2013
    Thank you folks, that did it! I thought I was up to date.. :oops:
    Participant
    August 21, 2013
    Does this make deferred rendering more viable? I have gotten kind of spoiled and going back to forward rendering for rift development has been a nuisance.