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
    May 9, 2013
    Thanks David - do you require Visual Studio to recompile the project in order to get things running? I do not currently own Visual Studio.
    Up and Coming
    May 9, 2013
    @space123321:
    Yes, it does require Visual Studio. But you should be able to use either the VS2010 or VS2012 express versions, which are free. Many of our community members use these free versions.

    - Dave
    Torque 3D, open source game engine Torque 3D Game Development Cookbook
    Up and Coming
    May 10, 2013
    Hi David - I have attempted to recompile a new project twice however the rebuild fails in VS2010 express C++ with the following error:

    16>------ Build started: Project: New Project0, Configuration: Debug Win32 ------
    16> main.cpp
    16>LINK : fatal error LNK1104: cannot open file 'C:\Users\Bryan\Desktop\Torque3D-3-0\Torque3D\My Projects\New Project0\game\New Project0_DEBUG.lib'
    ========== Build: 14 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

    Any suggestions would be greatly appreciated. Please note That I have used the project manager to add the rift module as per your instructions as well as regenerated the project once the module was added.
    Up and Coming
    May 10, 2013
    @space123321:
    Hmm. What you've shown isn't likely the actual error but the result of the error. Would you be able to look through the output and see what the trouble is? In Visual Studio you could also add the Error List tab where is summarizes the compile and link errors.

    But just to let you know: We've had a discussion about the Rift and the result is we will put together a new Template that includes Torque 3D 3.0 already compiled for the Rift, along with the required script changes. You should then be able to create a new project based on this Template using the Project Manager and be ready to go from the start.

    If you want to modify the source code, or run in a debug build you would still need to recompile, of course. But this should get people started off right away. I'll let you know when that Template is available.

    - Dave
    Torque 3D, open source game engine Torque 3D Game Development Cookbook
    Up and Coming
    May 10, 2013
    That is great news David - really appreciate your dedication to getting the Rift up and running on Torque. I will most likely wait for the template to be released. In any case, these are the errors that were received:

    Error 1 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 2 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 3 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 4 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 5 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 6 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 7 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 8 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 9 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 10 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 11 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 12 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 13 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 14 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 15 error C1083: Cannot open include file: 'xaudio2.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\sfx\xaudio\sfxxaudiobuffer.h 26
    Error 16 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 17 error C1083: Cannot open include file: 'xaudio2.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\sfx\xaudio\sfxxaudioprovider.cpp 26
    Error 18 error C1083: Cannot open include file: 'xaudio2.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\sfx\xaudio\sfxxaudiovoice.h 26
    Error 19 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 20 error C1083: Cannot open include file: 'xaudio2.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\sfx\xaudio\sfxxaudiovoice.h 26
    Error 21 error C1083: Cannot open include file: 'd3dx9.h': No such file or directory c:\users\bryan\desktop\torque3d-3-0\torque3d\engine\source\gfx\d3d9\gfxd3d9device.h 31
    Error 22 error LNK1104: cannot open file 'C:\Users\Bryan\Desktop\Torque3D-3-0\Torque3D\My Projects\New Project0\game\New Project0_DEBUG.lib' C:\Users\Bryan\Desktop\Torque3D-3-0\Torque3D\My Projects\New Project0\buildFiles\VisualStudio 2010\projects\LINK
    Up and Coming
    May 13, 2013
    @space123321:
    It looks like you don't have the DirectX 9 SDK installed. You may get it here: http://www.microsoft.com/en-ca/download/details.aspx?id=6812. And it looks like we don't have that listed in the docs on GitHub, so sorry about that.

    I'm hoping we'll have the Rift Template ready for later today, but it will depend on our testers' time.

    - Dave
    Torque 3D, open source game engine Torque 3D Game Development Cookbook
    Participant
    May 13, 2013
    I'd love to use this engine, can't wait for Dusan Jocic to port the client to Linux (assuming he's still working on it). :)
    Up and Coming
    May 13, 2013
    Thanks again for the update David - looking forward to testing the template once available!
    Up and Coming
    May 15, 2013
    @space123321:
    Sorry it took a little longer than anticipated, but here is the Rift template to get you started:

    Rift-Template-3-0.zip

    Extract this package into your Torque3D/Templates directory and follow the instructions in its ReadMe.txt. I'm hoping to announce this new template in a blog later in the week, but you guys get the first crack at it.

    Oh, and as an added feature, this template includes multiplayer. :D

    - Dave
    Torque 3D, open source game engine Torque 3D Game Development Cookbook
    Up and Coming
    May 15, 2013
    ANOTHER GREAT BIG THANK YOU!!!

    I am grabbing this now however will be out for awhile. I will work with this tonight and advise how it goes. Thanks again!

    Update - as I was to giddy to hold off - I followed instructions as follows and everything works like a charm!!! I can't wait to start diving into Torque 3d with the available books and teaching material out there.

    Thanks again David!!! The hydra importation will be next on my wish list :D