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

    Up and Coming
    May 22, 2013
    That newer screenshot looks like a huge improvement over the screenshot in your first post above. I am looking forward to when I can play with this.

    When I open that image in a new window so I can see all of it, and then resize it so I can do a stereoscopic merge, it looks about the same wide-eye and cross-eye view. Is it a stereoscopic image pair?

    Your original (first post) image does seem to be rendered behind the portal, but this one seems flat on the screen...
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    TeraBitAuthor
    Up and Coming
    May 22, 2013
    Your original (first post) image does seem to be rendered behind the portal, but this one seems flat on the screen...

    The entire thing has been re-written, so it uses a different approach to the camera shader to allow for varying FOV, IPD, Distortion, Stereo on/off etc. It's hard to tell what works without a Rift. On the plus side, my order turned to 'Processing' last Friday, so hoping to see it soon. :D

    I don't know if a video clip will be any more useful, so...



    [edit]
    Oh and another attempt at the screenshot...
    Regards, Lee Page TeraBit Software
    Up and Coming
    May 22, 2013
    Okay, that video seems to default to cross-eye view. It does look like it is behind the round window portal, but it still looks flat. Other than the position relative to the window, cross-eye or wide-eye viewing does not matter much. The screenshot also looks a bit flat (other than the window).

    I think you need to increase the distance between the cameras (more parallax). And for the Rift, you will need to bring those image centers closer together by clipping the inner edges a little.
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    TeraBitAuthor
    Up and Coming
    May 22, 2013
    The more I look at it, the more things seem a little off in the 3D. Not sure what the cause is, but will calibrate it a bit more once my now 'Processing' Rift arrives. 8-)

    This is my first time doing stereo rendering and have simply opted to move the ray origins to the left and right of the initial ray eye, but still pointing in the same direction relative to each eye (which is what I heard the Rift uses).
    Regards, Lee Page TeraBit Software
    Up and Coming
    May 22, 2013
    I think you just need to move MORE to the left and right (i.e. more parallax).
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    TeraBitAuthor
    Up and Coming
    May 22, 2013
    Ok... doubled the parallax..


    Any better?
    Regards, Lee Page TeraBit Software
    Inspiring
    May 22, 2013
    Seems way too big -- I can't fuse those two images together using crossed eyes. Can't you just calculate ~64mm in whatever scale you're using for this?
    Titans of Space PLUS for Quest is now available on DrashVR.com
    Up and Coming
    May 22, 2013
    "TeraBit" wrote:
    Ok... doubled the parallax..
    ...

    Any better?

    The 3D parallax is MUCH better. The eye separation does not have enough overlap, so I have to shrink the image to view it on my rift, which affects the barrel distortion/ It looks about right, but there are some vertical alignment issues (perhaps caused by image reduction). I need to twist my Rift on my face a bit when looking at different spots in the images.

    At fullscreen, this one makes me diverge my eyes in places (too much).

    To know if the pre-warp is correct, I need one with about 90-pixels of overlap. The height is a lot more than required, if you want to save processing time. The round lenses give a round FoV, so round images should work well (with center overlap). I recommend about 720-pixels diameter worst-case per eye (before overlap), for those who can see all the way to the outer edges of their display. When calibrated as Valve recommends (not for me), perhaps 480-pixel diameter is enough...
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
    TeraBitAuthor
    Up and Coming
    May 22, 2013
    "geekmaster" wrote:
    The eye separation does not have enough overlap

    When you say eye separation, are you talking about where the circles are placed on the screen? Currently they are placed in the centre of each half of the screen.

    So there are two things going on here. The distance between the 'eyes' in the virtual world, then where the rendered pixels are placed in the horizontal plane of the screen in relation to the lenses of the rift?
    Regards, Lee Page TeraBit Software
    Up and Coming
    May 22, 2013
    "TeraBit" wrote:
    "geekmaster" wrote:
    The eye separation does not have enough overlap

    When you say eye separation, are you talking about where the circles are placed on the screen? Currently they are placed in the centre of each half of the screen.

    So there are two things going on here. The distance between the 'eyes' in the virtual world, then where the rendered pixels are placed in the horizontal plane of the screen in relation to the lenses of the rift?

    I mean that some objects are too far apart for stereoscopic convergence when viewed in my Rift, unless I reduce the size of the image (which messes up the pre-distortion a bit). AFTER rendering the two images, you need to display them closer together, by cropping a bit of their inner edges.
    This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.