Skip to main content
Up and Coming
May 10, 2013

Rift Ray-tracing

[EDIT] This now has a demo, but I'll keep the link here up to date.

Download demo
(Updated to 12 Meg. Ver 0.50 on the Twentieth of June in the Year Twenty-Thirteen)).

Hi All,

I haven't got my Rift yet (UK near the end of the Kickstarter), but have been following the goings on with interest.

I've started to have a go at doing some CUDA based ray-tracing for VR and have managed to get some basic stuff going.

Rather than warping a resulting image I've made a start at modeling the lenses in the ray projection code.
(no texturing or shadows yet, just trying to get the distortion and stereo going.)

This is what I've got so far. It's probably waaaay out, but until I get my one, I'm flying blind. :D

Note: It's a bit wide to see in the post, you may need to open the image in another tab to see the entire screen.

    152 replies

    TeraBitAuthor
    Up and Coming
    May 31, 2013
    Well it's been a little while since I did an update.

    I've added in the remainder of the textures etc. in the mesh loader, head tracking is now working properly and introduced a kind of mip-mapping based on something other than ray differentials. It works on Texture / Triangle density over varying distance and angle. Seems to work quite well.


    The distortion is still a bit wobbly. I need to work on this more next, then on to ray based collision. 8-)
    Might even have a playable demo soon.
    Regards, Lee Page TeraBit Software
    Up and Coming
    May 31, 2013
    Yes, that is looking pretty damn awesome. I can't wait to try out your demo! :D
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    Participant
    June 2, 2013
    Same here! Really interested in how this is progressing, and eager to try it out!
    TeraBitAuthor
    Up and Coming
    June 3, 2013
    Ok, test time.

    Download demo (25 Meg.).

    Not sure how well it will work on another machine. I think you need a recent-ish Nvidia Geforce (4,5,6,7) with recent drivers. Just run the executable in the folder (a .NET exe), and leave all the .DLLs with it.

    (make sure you have your rift plugged in. You can either do a clone (at 1280x800) or extend desktop (with the rift at 1280x800).

    WASD keys or Hold both mouse keys to fly forward.
    Regards, Lee Page TeraBit Software
    Up and Coming
    June 3, 2013
    I have my Rift plugged into my mobo intel HD-4000 graphics at the moment, so the lag in this makes me feel a bit queasy from just looking around. But the view is pretty spectacular. I will try this with my Nvidia card later.

    It is really looking great! Keep up the excellent progress. What are your plans for this? I would LOVE to see some source code.
    :D
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    Participant
    June 3, 2013
    Crashes on an NVIDIA GK104 Win7 x64 box with Driver 311.35

    No rift plugged in if it matters (which it might if you're depending on it being there)... I'm still processing...

    Any plans for multiGPU support? Say a GPU per eye? :)

    Crash log...
    ************** Exception Text **************
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at eIjdit386dfDFaKRDO.cUcNZsq08hFVI2cTsl.Dpknaagcvp(String& , String& , String& , String& )
    at TestCUDAInterop.Form1.ILD4SE8yMB(Object , EventArgs )
    at System.EventHandler.Invoke(Object sender, EventArgs e)
    at System.Windows.Forms.Form.OnLoad(EventArgs e)
    at System.Windows.Forms.Form.OnCreateControl()
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.Control.CreateControl()
    at System.Windows.Forms.Control.WmShowWindow(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
    at System.Windows.Forms.Form.WmShowWindow(Message& m)
    at System.Windows.Forms.Form.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5466 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    TestCUDAInterop
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Mark/Downloads/RiftRT/RiftRT.exe
    ----------------------------------------
    Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5468 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    ----------------------------------------
    4c9fcfad-c593-47d6-b804-d013370c448a
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Mark/Downloads/RiftRT/RiftRT.exe
    ----------------------------------------
    TeraBitAuthor
    Up and Coming
    June 3, 2013
    No rift plugged in if it matters (which it might if you're depending on it being there)


    Yeah, I'm just assuming it's there at the moment. But it seems to run ok on my local machine if it's unplugged.

    Um.. Dunno why it's not working for you. :(

    Any plans for multiGPU support? Say a GPU per eye?


    It's based on a CUDA Ray Tracing extension called Optix, so it should be good to go on multi GPU.

    However, my demo is held together with sticky tape at the moment so there could be any number of things that could go wrong with it.

    GK104 :o - Is that a Titan or a GF7 ?
    Regards, Lee Page TeraBit Software
    TeraBitAuthor
    Up and Coming
    June 3, 2013
    I have my Rift plugged into my mobo intel HD-4000 graphics at the moment...


    Wait.... it works on an Intel HD-4000!!?? :shock:
    Regards, Lee Page TeraBit Software
    Up and Coming
    June 3, 2013
    "TeraBit" wrote:
    I have my Rift plugged into my mobo intel HD-4000 graphics at the moment...

    Wait.... it works on an Intel HD-4000!!?? :shock:

    Yes, it does work on my intel HD-4000 integrated graphics, using the HDMI port on one of my GIGABYTE G1.Sniper 3 mobos with my Core i7-3770K CPU and 32GB PC3-12800 DDR3 RAM. But it is not fast enough to keep my dizziness suppressed while looking around (or especially while moving). There is significant lag. But the image quality looks GREAT!

    I *DO* have an Nvidia GeForce GTX260 video card plugged in (driving my main displays), if that matters.
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    TeraBitAuthor
    Up and Coming
    June 3, 2013
    Ok, that makes sense. It's using the GTX 260 to do the tracing and just rendering the Framebuffer on the intel. Cool it works on a GF260 8-)
    Regards, Lee Page TeraBit Software