Skip to main content
Up and Coming
February 27, 2013

Making Progress with Torque 3D

Hey Rift Peeps!

I've decided to tackle the barrel distortion shader first with Torque 3D. That way I can immediately see my results of my work in the Rift.

For now, I've not worried about rendering a stereo pair from the engine as that will require some modifications to Torque 3D's graphics pipeline. In its place I take T3D's standard rendering and crop out a center strip (with the cropping shifted left and right to simulate the eye separation based on values from the OVR SDK) and build a stereo-like pair. So far this has been a decent stand-in for true stereo rendering.

I then apply the OVR SDK given barrel distortion shader to my fake stereo-pair image and end up with the following:

T3D-Rift-Test-02.jpg

I'm also not scaling up the input texture (as discussed in section 5.6.3 of the docs) and instead am taking a hit to the resolution of the final image to get the larger FOV. In the image above I'm scaling the distortion shader's Scale constant by 0.8. Down the road I'll add proper support for the larger input texture to Torque 3D (which will also require some graphics pipeline changes).

Even without true stereo rendering the experience in quite compelling. Next up, head tracking!

My ultimate goal would be to combine my Razer Hydra integration with the Rift for a sweet demo. If you're interested, you can read about my T3D Hydra integration here: Torque 3D Now Supports the Razer Hydra Controller.

- Dave

EDIT: Image attachments are pretty limited in size, eh? It would be great if the forum supported auto-scaling of the image with a link to the full size.

    43 replies

    Up and Coming
    April 12, 2013
    I hope to soon, but with my order number and only 500 kits per week shipping it looks like I'll have to way until summer for that. Maybe if Oculus can speed up shipments I can start contributing before that. =)
    Up and Coming
    April 18, 2013
    For anyone that is following this thread, we've just released a new Torque 3D based demo:

    View the Aurora Borealis Using the Oculus Rift and Torque 3D

    This demo shows off the Theora texture object mapping that will be merged into our development branch by the end of the week. This allows you to map videos to any surface. Other than that, anyone could make a similar demo with what is currently available in Torque 3D's development branch.

    - Dave
    Torque 3D, open source game engine Torque 3D Game Development Cookbook
    Up and Coming
    April 23, 2013
    If we can map a video to a surface, could we map a 3D video to a surface?
    Palmer on the openness of the Rift: http://www.reddit.com/r/oculus/comments/21cy9n/the_future_of_vr/cgc06b2?context=3 All of Palmer's Reddit posts: http://www.reddit.com/user/palmerluckey
    Up and Coming
    April 23, 2013
    You might be able to with some modifications. Working with 3D video means you want to display a different image for each eye. If you had a video stream where each eye was on a different physical half of whole image (such as side-by-side) then you could choose which half to use based on which eye is currently being rendered. Torque 3D does tell you which eye is currently being rendered (I set up the GFX system to tell you field 0 or 1) so you may be able to just slide the video from one half to the other.

    Hmm, this would be interesting to try. If you allow the player to freely roam about an object that has a 3D movie mapped to it, I would expect you would get the same effect as looking at a 3DS screen. If you're in the sweet spot then it could look 3D. But if you go too far then your eyes cannot resolve the 3D effect. That sounds like a cool experiment to try some time.

    - Dave
    Torque 3D, open source game engine Torque 3D Game Development Cookbook
    Up and Coming
    April 24, 2013
    I was inspired by someone on youtube who rendered a wilderness scene with a big screen floating in midair playing the 3D trailer for MIB 3. You could wander around and it was pretty cool, although I had to watch it in anaglyph. I want to make something like Virtual Cinema by Namielus, but personalized to me. I also have an idea for hooking the Directx for games like starcraft where it can't really be converted to an immersive experience and and piping it to a virtual 3D monitor, sort of like Ibex, complete with parallax when you move your head. I think that will work best as an AR app.
    Palmer on the openness of the Rift: http://www.reddit.com/r/oculus/comments/21cy9n/the_future_of_vr/cgc06b2?context=3 All of Palmer's Reddit posts: http://www.reddit.com/user/palmerluckey
    Up and Coming
    April 28, 2013
    I'm somewhat interested in playing around with Torque again (tried it once when I was in high school about 6 years ago), but am put off by the fact that the main beginner's tutorial and such seem to be outdated. Any plans to update these or are you pretty busy on other projects?
    Up and Coming
    April 28, 2013
    "DieKatzchen" wrote:
    I also have an idea for hooking the Directx for games like starcraft where it can't really be converted to an immersive experience and and piping it to a virtual 3D monitor, sort of like Ibex, complete with parallax when you move your head. I think that will work best as an AR app.


    How would you do this? I have little programming experience and almost all of it long ago (I intend to start learning again) so please don't get TOO technical. I'd be very interested in getting MAME output to interactively render to a texture in a 3D arcade environment. Would MAME need to be modified? Could this be hooked into Unity engine RenderTextures?

    I wish it was possible to just create conduits between windows in the OS (whether Win, Lin or OSX) and "textures" in 3D engines. Seems like this would be an incredibly useful and powerful capability.

    Sorry for rambling. I'd love to hear ideas from people who actually have some understanding of what would be involved.
    Up and Coming
    April 28, 2013
    Currently my "how I would do it" is limited to how I would get proper parallax and separation, I haven't gotten to how I would pipe the video in. For something like that you'd be better off asking Hesham, the creator of Ibex. The parallax and separation problem is actually simpler than it sounds. I would have a fiducial marker (or better, an array of them) and I would map a plane to it. Then I would map the virtual camera to where the real camera was and the plane defined by the fiducial marker(s) to the near plane. The resulting view frustum will be identical to the actual frustum that camera would see. I do it again for the other camera and BOOM, stereo separation. Move your head and BAM, parallax.

    Theoretically, of course. I haven't tested it yet.
    Palmer on the openness of the Rift: http://www.reddit.com/r/oculus/comments/21cy9n/the_future_of_vr/cgc06b2?context=3 All of Palmer's Reddit posts: http://www.reddit.com/user/palmerluckey
    Up and Coming
    May 9, 2013
    Torque 3d 3.0 has been just released. I am going through the steps listed on the wiki site to get the oculus working however not having any luck... will keep at it!!!
    Up and Coming
    May 9, 2013
    I've just been making the rounds to announce the launch of Torque 3D v3.0 and I see you beat me to it. :D

    Torque 3D Open Source 3.0 Launch Blog

    @space123321:
    I just updated the wiki pages for getting the Rift working with T3D so perhaps that will help out?

    https://github.com/GarageGames/Torque3D/wiki/Oculus-Rift

    The two big steps are downloading the OculusVR SDK and recompiling your project with the required source code. This is talked about here: Setting Up Your Project for the Oculus Rift After that there are some script changes you'll need to make as covered here: Using the Oculus Rift Head Mounted Display

    Please do let me know if you run into any trouble. I would like to make sure the documentation is as helpful as possible.

    - Dave
    Torque 3D, open source game engine Torque 3D Game Development Cookbook