Skip to main content
Inspiring
June 18, 2013

AA vs downscaling from higher resolutions

I think it might be a good idea to re-open this discussion as there seems to be a fair amount of friction between those that find that downscaling from 1920x1080 is an acceptable way to improve image quality in the Rift vs those that find it unacceptable and comes with a potential increase in latency.

With Unity, I've explored a multitude of options:

1) No AA, using native Rift resolution of 1280x800.
2) No AA, downscaling from higher resolution.
3) Anti aliasing as a post effect, occurs after lens correction and chromatic aberration
4) AA between lens warp and chromatic aberration correction.
5) 2x/4x/8x MSAA via Unity's quality settings

Note that at this time, the #5 option here does not actually function like UDK's ScreenPercentage setting because the MSAA textures are not yet accessible. I'm guessing that when Unity does support this, the quality settings are all that we'll need to get a simple and effective "ScreenPercentage" setting in Unity.

Also note that at this time, the #4 option is not possible unless we make some significant changes to the Oculus Unity integration (and I personally haven't taken the time to try out a proof of concept).

So for the time being, that realistically leaves us with #1 (No AA at 1280x800), #2 (No AA, downscale from higher res), and #3 (AA using one of Unity's several AA image effects), and maybe even a combination of these.

Here are screenshots taken of some text that does not squarely face the user, although the user is looking directly at it. The text should read "0%":

1280x800 (No AA, 4xMSAA, postwarpAA):


1600x900 (No AA, 4xMSAA, postwarpAA):


1768x992 (No AA, 4xMSAA, postwarpAA):


1920x1080 (No AA, 4xMSAA, postwarpAA):


My conclusions:

1) I find that post-warp AA done as an image effect softens up the scene details too much, darkens it, etc. Not acceptable (and also has a not insignificant hit to frame rate).

2) I don't see much difference in legibility between no AA and using 4xMSAA in Unity's quality settings, so might as well not use it in favor of performance, although one could definitely make the argument that straight edges would benefit from it.

3) The higher the resolution the better, and even running at 1768x992 looks like it starts to provide acceptable readability of that "0%".

4) I don't have a way to test the latency difference between native 1280x800 and downscaling from a higher resolution, but it sure doesn't seem to feel any different to me, even with looking around all over the place real fast like a crazy person.

Therefore, until Unity allows access to MSAA textures, just use as high a resolution as you can? :)
    This topic has been closed for replies.

    83 replies

    drashAuthor
    Inspiring
    November 6, 2013
    Interesting! Would love to try the solution you posted boone, but I am getting a "The selected attachment does not exist anymore." message.
    Titans of Space PLUS for Quest is now available on DrashVR.com
    Up and Coming
    November 6, 2013
    "drash" wrote:
    Interesting! Would love to try the solution you posted boone, but I am getting a "The selected attachment does not exist anymore." message.

    Try again. This link works for me: https://developer.oculusvr.com/forums/download/file.php?id=1126
    drashAuthor
    Inspiring
    November 6, 2013
    That worked this time, thanks. :)

    I tried it out on a scene I have, and I find there's a definite visual difference with this approach. In some cases, far better, and in some cases, worse.

    Seems like you can basically pick up on quite a bit more fine geometry which can be good or bad, depending on the aliasing you now get. I had 4x MSAA on, and faraway thin geometry broke up into distinct pieces instead of a generally continuous sliver. I'm not sure I'm using it in the most optimal way and whether I need to do anything else to have it play nice with MSAA.

    On the REALLY bright side, this appears to make the nasty white specular highlighting on sharp edges go away. I'm digging that a lot. Going to keep experimenting.

    I got about a 10% framerate reduction using 4 camera scalers on two pairs of OVRCameras (near+far setup). Not a performance improvement but not a bad hit either!
    Titans of Space PLUS for Quest is now available on DrashVR.com
    Up and Coming
    November 6, 2013
    "drash" wrote:
    I had 4x MSAA on, and faraway thin geometry broke up into distinct pieces instead of a generally continuous sliver. I'm not sure I'm using it in the most optimal way and whether I need to do anything else to have it play nice with MSAA.

    Yeah far away details are a problem for the SSAA that is being done by the scalers. If an object is just a few pixels wide, it can be missed completely by the downsampling. If I add bicubic sampling that should help a lot. I've got an experimental build that can apply additional AA as postprocess (FXAA, NFAA, etc). That can help mitigate the problem a bit. I will try to release that soon.

    "drash" wrote:
    I got about a 10% framerate reduction using 4 camera scalers on two pairs of OVRCameras (near+far setup). Not a performance improvement but not a bad hit either!

    Whoa, 4 cameras! That is a lot of rendering. What kind of GPU(s) are you using?
    Up and Coming
    November 6, 2013
    It might not be so much rendering if you're using near/far clip planes to split it. I think this is useful for cockpit things like flight sims.

    It's given me another idea however, you could render two seperate cameras for the inner/outer part of the view. Since you only look directly at the inner ~45 degrees most of the time, you could render that at a higher resolution & with AA, etc. You could then render the outer ~90 degrees at a much lower resolution and composite them together.

    If you were able to set a scissor/stencil to cull out the unwanted areas for each pass, you'd save some GPU time too.

    Might be worth messing around with!
    GunLock - Multiplayer FPS UE4 Rollercoaster HydraDeck - RTS
    Up and Coming
    November 6, 2013
    boone188: I tested out your CameraScalar component, it works really well!

    One thing I noticed, if you enabled AntiAliasing on the RenderTexture (e.g. rt.antiAliasing = QualitySettings.antiAliasing), you can reduce the ScaleFactor quite a bit. I was running with 4x MSAA and ScaleFactor 1.35x and it still looked quite good.

    Note; the default Unity Quality Settings on "Fantastic" is only 2x MSAA

    You could probably also tie in the ScaleFactor to one of the QualitySettings to allow it to be disabled for low end machines.

    Also, cybereality, you guys should integrate this into the next Unity drop!
    GunLock - Multiplayer FPS UE4 Rollercoaster HydraDeck - RTS
    Inspiring
    November 6, 2013
    On quick glance this seems to work very well. Nice job.

    We will have to do some testing here but, if it doesn't break anything, we may want to roll this into the official SDK.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    November 6, 2013
    One other thing I noticed, you get better results if you apply the Lens Correction on the final camera, rather on the upscaled camera. It give better sampling, fixes some aliasing you'd see from the chromatic aberration and also gets back a little performance.

    I hope you don't mind boone, I've modified your code an put it in the attached package.

    It's a straight replacement for the OVRCamera.cs. Just set the "Camera Texture Scale" on both cameras to something sensible (like 1.0, 1.35, 1.5, 2.0)
    GunLock - Multiplayer FPS UE4 Rollercoaster HydraDeck - RTS
    Up and Coming
    November 6, 2013
    "Teddy0k" wrote:
    boone188: I tested out your CameraScalar component, it works really well!

    One thing I noticed, if you enabled AntiAliasing on the RenderTexture (e.g. rt.antiAliasing = QualitySettings.antiAliasing), you can reduce the ScaleFactor quite a bit. I was running with 4x MSAA and ScaleFactor 1.35x and it still looked quite good.

    Note; the default Unity Quality Settings on "Fantastic" is only 2x MSAA

    You could probably also tie in the ScaleFactor to one of the QualitySettings to allow it to be disabled for low end machines.

    Also, cybereality, you guys should integrate this into the next Unity drop!

    The problem with enabling AA on the RenderTexture is that it will actually kill shadows. I believe this is a bug that is being fixed by Unity. I could spend some time trying to find a workaround though.
    Up and Coming
    November 7, 2013
    "cybereality" wrote:
    On quick glance this seems to work very well. Nice job.

    We will have to do some testing here but, if it doesn't break anything, we may want to roll this into the official SDK.

    That would be cool. It would be pretty simple to move this into the OVRCamera.