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

    Up and Coming
    November 7, 2013
    One final thing that makes a big difference to the quality is improving the sampling used in the distortion shader. I've changed it to a bicubic filter, which reduces a lot of the blurriness introduced by this method. Note; you need to use the texel size of the source texture, so that's the upscaled resolution.

    So here's a side by side, on the left is vanilla unity and on the right it's rendering with;
    -2x supersampling
    -4x msaa
    -bicubic filtering


    It makes a huge difference in game, and doesn't eat too much frame rate. It removes much of the "swimming" or "fizzing" you see as pixels change as you turn your head around, which is very distracting in VR.

    Here's another package with the shaders included this time, and I've linked the scale and AA settings to your rendering settings (Good 1.35x, Fantastic 1.5x, Beautiful 2.0x)
    GunLock - Multiplayer FPS UE4 Rollercoaster HydraDeck - RTS
    Inspiring
    November 7, 2013
    @Teddy0k: I just tried your package on a fresh version of Tuscany and it had some issues. First of all shadows were all out of whack (clipping through the walls, etc.). Also, the overall image quality looked blurry, even on fantastic quality. Not sure if I did something wrong or what. It wasn't working for me.
    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 7, 2013
    I think for now we should just stick to SSAA. It provides the greatest increase in visual fidelity with the littlest increase in latency. It has no effect on dynamic lighting or shadows. I want to have perfect rendering, but that would be improbable.
    Up and Coming
    November 7, 2013
    Seems some people have problems with MSAA in Unity, which is too bad. Having the sub texel information combined with the sumpersampling gives very high effective resolution, which helps remove so much of the swimming/fizzing.

    For what it's worth, it works on my machine (Radeon 7700 Series) and it looks great! Here's the Tuscany level I exported, can you test this cybereality and tell me if you get the same issues?
    https://drive.google.com/file/d/0B1KRnJKwYT-0WmZOU0hCWFdoSU0/edit?usp=sharing

    It's also worth noting that this technique should only be run in native rift resolutions (1280x800) or else it'll kill your performance. Not sure if you can lock resolution options in Unity?

    I did some tests with Unity's FXAA, but all of their techniques have some pretty bad artifacts, which are magnified after you run the lens correction. Are you doing AA pre-correction or post-correction boone?
    GunLock - Multiplayer FPS UE4 Rollercoaster HydraDeck - RTS
    Up and Coming
    November 9, 2013
    "Teddy0k" wrote:
    I did some tests with Unity's FXAA, but all of their techniques have some pretty bad artifacts, which are magnified after you run the lens correction. Are you doing AA pre-correction or post-correction boone?

    I've tried performing AA before and after the lens correction. I almost always feel that the softening it provides is unwanted in VR. I think our needs for AA in VR might be quite different than on a flat monitor. It seems that any softening of the image up close is very bad. In the distance it is great.
    Up and Coming
    November 9, 2013
    @Teddy0k- the image quality is indeed the best I've got in Tuscany demo. Unfortunately I'm also getting shadows error.
    Up and Coming
    November 9, 2013
    Hi teddy0k,

    I tested your code on a demo I'm working on. Working great for me. No glitches.

    gfxcard: Nvidia GTX680
    Running the demo at 1920x1080, with deferred rendering.
    Up and Coming
    November 9, 2013
    I tested this demo:
    https://drive.google.com/file/d/0B1KRnJKwYT-0WmZOU0hCWFdoSU0/edit?usp=sharing

    and it's very cool ! I have shadows (tree for examples) and it's very nice, no aliasing. :shock:

    I am making a professional oculus game, what is the secret ? :D
    Thanks !
    Up and Coming
    November 9, 2013
    No big secret, just supersampling with MSAA and bicubic filtering. It's detailed a bit in this thread, and there's some sample Unity code to test too.

    I've noticed there's some bugs with the Bicubic filtering, if its upscaled less than 2x it makes it quite blurry. I'm going to research a few different methods for the filter kernel to improve this.
    GunLock - Multiplayer FPS UE4 Rollercoaster HydraDeck - RTS
    Up and Coming
    November 9, 2013
    I made a little demonstration of the basic supersampling: https://www.dropbox.com/s/cd9cked007dmnsd/BigBufferTuscany.zip

    - Left mouse click enabled/disables the supersampling
    - Press 1-5 to change scaling factor
    - Right mouse click to hide/show text