Skip to main content
Up and Coming
January 30, 2014

Bicubic Warp Reconstruction

Hi All,

I've been playing around with hacking a dynamic Bicubic reconstruction filter into the Standard Rift HLSL Warp Shader.

So far it's been going quite well, with just a standard sized buffer it seems to eliminate most of the shimmery artifacts without sacrificing too much in the way of detail. I only just got it working, so it's not really tuned yet, but:

Standard Chromatic Corrected Filter


Bicubic Version


Standard Blown Up


Bicubic Blown Up


This is running on a modified OculusWorldDemo executable.

    37 replies

    Up and Coming
    January 30, 2014
    So it's sort of FXAA for barrel distortion?
    TeraBitAuthor
    Up and Coming
    January 30, 2014
    "raidho36" wrote:
    So it's sort of FXAA for barrel distortion?

    Kind of, but it operates at the warp stage. An updated HLSL warp shader that uses a different reconstruction system to the standard warp distortion shader. It's not run as a post process or anything like that.
    Regards, Lee Page TeraBit Software
    Inspiring
    January 31, 2014
    Wow! That looks really good. Nice job.
    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
    Inspiring
    January 31, 2014
    What's the basis of the difference? And what's the performance difference?
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    January 31, 2014
    I beleive unless performance is for some wild reason is utterly inferior, it's completely out of concern.

    From what I can tell, the "reconstruction" kills some good bit of detail.
    Inspiring
    January 31, 2014
    "raidho36" wrote:
    From what I can tell, the "reconstruction" kills some good bit of detail.


    Actually, what you're calling detail looks a lot to me like noise. The transitions between foreground and background objects in the conventional warp effect seems to be far more jaggy to me. Of course it's hard to make a fair evaluation because as far as I can see the bicubic reconstruction isn't apply chroma correction, while the conventional one is.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    Up and Coming
    January 31, 2014
    Yes it does looks like a noise, however it's a fine detail rather than actually a noise - meaningful information rather than random flood. We're all know by now how imperative it is to transmit as much data per pixel as possible, and thus throwing away a good bit of meaningful information just to smooth out appearance a little is a bad move. Particularry, the iRacing community have established that exactly this kind of throwing the data away (mip-mapping) is the sole reason why iRacing textures lack of visual clarity so badly, as opposed to LFS. The exact reason why LFS look so much better is it lets you crank mip-map bias all the way up which virtually prevents any visible mip-mapping, thus maximizing amout of per-pixel data quite far above of what 1 pixel can actually display. Small camera movements that happen constantly get this overly detailed "noisy" textures to reveal parts of visual data that previously didn't hit the pixels because they weren't in exactly right positions, so that the brain can assemble them together, increasing effective Rift's resolution. This is similar to how the brain overcomes low actual retinal resolution to build very high effective eye resolution.
    Up and Coming
    January 31, 2014
    "raidho36" wrote:
    Yes it does looks like a noise, however it's a fine detail rather than actually a noise - meaningful information rather than random flood.

    Actually it is aliasing and not meaningful at all. Reducing aliasing contributes a lot to the visual stability and fidelity of the final image.
    Watch panoramic 3D photos, videos and do FPV-flying with LiveViewRift! viewtopic.php?f=28&t=11001
    TeraBitAuthor
    Up and Coming
    January 31, 2014
    Hi all,

    It's possible I dialled in the magic numbers by accident, but I haven't had a chance to do much with it since I first posted. On the other hand, there are a few settings that are variable and I want to make them interactive so you can increase or decrease the effect and where it is applied (it is not applied uniformly across the warp).

    Once I have the interactive part going I'll post the executable (along with an explanation of what it is actually doing and why) and let everyone have a go and see where the consensus is about what numbers to dial in.

    That way it can be an optional add on.

    Also even in the current state, I think it is a little softer than I would like, but is a noticeable improvement over the normal warp reconstruction, especially when moving (which you can't see in the images), since it suppresses the shimmery effect and reduces Moiré.

    As to performance, it's not as bad as I though it would be. Even in it's current 'shotgun' state, I'm still getting > 120 FPS on my old GeForce 475.

    BTW: Both shaders are doing Chromatic Aberration Correction.
    Regards, Lee Page TeraBit Software
    TeraBitAuthor
    Up and Coming
    January 31, 2014
    Hi All,

    Here's the executable to play with: Download

    This is just the executable, but not assets, so you will need to copy the executable next to the 'Assets' folder in the Official OculusWorld Demo Folder "OculusSDK\Samples\OculusWorldDemo\" (included with the SDK) so it can find the assets it needs to run.

    That said, here's the Extra Key controls:

    • C - Switch between Bicubic Reconstruction and Standard (Both Chromatic Corrected)

    • Ins / Del : Increase or Decrease MaxSharpness

    • Home / End : Increase or Decrease MinSharpness

    • PgUp / PgDn : Increase or Decrease Warp Multiplier

    • Enter Key : Toggle Bicubic Warp Gradient Display

    • F11 - Fullscreen of the Rift!

    Let me know what numbers you like best (Max, Min, Mult). 8-)

    Theory
    As I understand it, when you run the warp shader, for every pixel in the texture, you warp the texture coordinates, blowing them progressively further out. As you get further from the centre of the lens, the greater the warp.

    The resulting image you see is significantly smaller than the original and since the LCD / OLED panels are uniform in their pixel distribution, you have a lot less pixels to present an image with.

    Although the warp concentrates more pixels in the middle of your vision, you don't actually see them, because to fit them in the middle, you are essentially skipping pixels.

    The way the Bicubic reconstruction works is to work out how much space each warped texel takes on the original unwarped image, set the appropriate sample size and integrate it with a Bicubic sampler.

    The result is that the closer to the middle you are, the larger the sample size (taking more pixels in the original image into account), the further out, the closer to 1:1 pixel samples you get.

    The aim is to represent more of the original detail in a smaller space, just like a Bicubic resample of a square image would.

    It's not optimised yet, but it seems to do what I wanted it to do, so have fun and let me know how you get on. :D
    Regards, Lee Page TeraBit Software