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
    June 8, 2013
    "scsioverdrive" wrote:
    Startup step 17 and drawframe step 10.

    Thanks.. I was afraid of that. :(

    It dies on the last step:-
    context->launch(0, width, height );


    Which is simply calling the CUDA to run. Now need to rig up something that can debug the CUDA kernel. :roll:
    Thanks for the help, I'm sure I'll be back :)
    Regards, Lee Page TeraBit Software
    TeraBitAuthor
    Up and Coming
    June 11, 2013
    Material system is working properly now. Transparency, Reflection, Refraction, Specular etc.
    Sponza

    Conference Room

    Getting there...
    Regards, Lee Page TeraBit Software
    Up and Coming
    June 11, 2013
    It is looking great! Dealing with the aliasing that can be seen in the mirror will probably suck CPU time, so I would not worry about that yet. Just try to keep the latency down. I was considering using MIP-map like reduced complexity models with smoothed textures as they recede into the distance to deal with such aliasing, but I did not go beyond just thinking about it yet. Just an idea, which might work for you. Based on past experience, I suspect that people are already doing that and I just did not stumble across it yet...

    But I really do like the new features. How did that impact your framerate?
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    TeraBitAuthor
    Up and Coming
    June 11, 2013
    "geekmaster" wrote:
    It is looking great! Dealing with the aliasing that can be seen in the mirror will probably suck CPU time, so I would not worry about that yet. Just try to keep the latency down....How did that impact your framerate?


    Both images were about 50-55 fps, so it's starting to struggle to keep up, but still pretty good for RT. Of course if look through a glass ball into a mirror it's going to hurt. :lol:

    "geekmaster" wrote:
    I was considering using MIP-map like reduced complexity models with smoothed textures as they recede into the distance to deal with such aliasing, but I did not go beyond just thinking about it yet.


    Like LOD models. In rasterisation it works very well I think, usually a few LODs for models before they go to billboard.

    In the case of Ray Tracing there are some problems. First of all, the acceleration structures (sBVH) I suspect would be tricky to swap out in real time for large collections of models.

    Also how do you determine distance in ray tracing before you fire the rays? Take the mirror for example, If I look at the mirror out of the corner of my eye, and see the window in it, those rays have travelled almost twice as far as the ones that hit the window directly on the left. The same model has been hit at two very different distances.

    It would be nice to get a FPS on a Titan or GF7, to see where performance might be in a year or so..
    Regards, Lee Page TeraBit Software
    Participant
    June 12, 2013
    Looks great! Does multiGPU work automagically or do you need to do additional work in Optix for it to function?
    TeraBitAuthor
    Up and Coming
    June 12, 2013
    "MarkV" wrote:
    Looks great! Does multiGPU work automagically or do you need to do additional work in Optix for it to function?

    As far as the documentation says, it should just scale to as many GPUs as you have. :)
    Regards, Lee Page TeraBit Software
    TeraBitAuthor
    Up and Coming
    June 12, 2013
    Mip-Mapped reflections added (before it only Mip-Mapped primary rays, now it goes the entire life of the ray).
    Added spotlights and a couple of extra models to make it interesting. 8-)
    Regards, Lee Page TeraBit Software
    Up and Coming
    June 12, 2013
    Awesome!

    Do MIP-mapped reflections increase the framerate in complex scenes? Can you switch that feature on and off for FPS comparisons?
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    Up and Coming
    June 12, 2013
    This is really nice, you can hardly notice the aliasing.

    Try something for me please if you have time. Randomly jitter your source rays so they do not all go straight through the pixel centers. I'd really like to see if that destroys the aliasing like I expect, especially if you change the seed every frame.
    (╯°□°)╯︵┻━┻
    TeraBitAuthor
    Up and Coming
    June 12, 2013
    "geekmaster" wrote:
    Do MIP-mapped reflections increase the framerate in complex scenes? Can you switch that feature on and off for FPS comparisons?

    I'll check and let you know.

    "jwilkins" wrote:
    Try something for me please if you have time. Randomly jitter your source rays so they do not all go straight through the pixel centers. I'd really like to see if that destroys the aliasing like I expect, especially if you change the seed every frame.

    Will give it a go soon.
    Regards, Lee Page TeraBit Software