Previous Blog Next Blog
Prev/Next Blog
by date

Plan for Tom Spilman

Plan for Tom Spilman
Name:Tom Spilman
Date Posted:May 21, 2005
Rating:4.8 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Tom Spilman

Blog post
Work on interactive gui texture surfaces on DTS shapes.
So we finally released Torque Pipeline and so far a lot of people have picked it up and seem to love it. If you don't know what Pipeline is you should check it out!

So aside from that i've been working on rendering GUIs on textures so that i can place them it in the environment and interact with them. My first attempt was focused on interiors and it worked out fairly well. But of course putting them on DTS shapes.... in particular physics driven DTS shapes was alot cooler. So that's what i did (the video uses the XviD codec):



It took me a long while thinking of how to properly integrate things into Torque... then i gave up and hacked it in. I added a castRayTri() function to TSMesh which would test all visible triangles on a shape against my ray and would return the material and UV hit point of the closest triangle. This could use some optimization, but it works for now.

The thing that drives all this, as described in this thread, is a new class called GuiTextureCanvas. It deals with rendering the GUI on to a dynamic texture and holds a static console method which will fire off the castRayTri() on the SceneObject you pass to it.

Oh and i'm totally screwing the server/client boundary here, but you know what... i don't care. The client server boundary is a bitch... especially when you're doing a single player game. I guess i need more experience with it.

The physics by the way are courtesy of Thomas Lund's rigid shape resource. I'm looking into other solutions as the rigid shape stuff leaves alot to be desired. Gary Brigg's stuff looks promising as well as Akio's. Still I'm taking a serious look at the NovodeX SDK as neither is really ready to be used (correct me if i'm wrong... we're willing to pay for working ODE/Newton/Novodex physices in Torque). Lucky for us our game is single player which should help alot.

I know people are gonna ask me to release this as a resource, but it requires alot of other stuff that is unrelated like my object interaction system. I would do it, but frankly i'm feeling too lazy to gather all the changes to make it available. I'll see if I can get some time to gather it all and organize it. It really is a lot of work putting up a good resource.

Recent Blog Posts
List:03/03/07 - Sickhead is hiring!
05/31/06 - Torsion Update
04/03/06 - Torsion Update & TelnetDebugger Fix
03/21/06 - Torsion Updated!
02/28/06 - Precipitation for TSE
07/18/05 - Plan for Tom Spilman
05/26/05 - Plan for Tom Spilman
05/21/05 - Plan for Tom Spilman

Submit ResourceSubmit your own resources!

Josh Moore   (May 21, 2005 at 06:53 GMT)   Resource Rating: 5
That's soo awesome!

Thomas "Man of Ice" Lund   (May 21, 2005 at 07:53 GMT)
Damn cool Tom!!! Damn cool

Ben Garney   (May 21, 2005 at 08:08 GMT)
Very cool, Tom. BTW, I have a castRayTri implementation, too... Hmm. Get in touch with me, maybe it's a good time to set up a little geometry helper lib in TGE. :)

Adrian Walters   (May 21, 2005 at 10:07 GMT)
that is so ace!

Anthony Rosenbaum   (May 21, 2005 at 16:57 GMT)
VEry neat

Daniel Allessi   (May 21, 2005 at 17:41 GMT)   Resource Rating: 5
GuiTextureCanvas - I don't have permission to access the forum thread. >_<

Tom Spilman   (May 21, 2005 at 18:09 GMT)   Resource Rating: 5
@Daniel - The class is actually fairly simple. It derives from GuiCanvas and adds creation of a texture render target on onAdd() and inspectPostApply(). It also overloads renderFrame() to set the render target then use begin() and end() to render the GuiControls added to the canvas. GuiCanvas has a slight change to render all GuiTextureCanvas instances before it renders itself (which renders the GuiTSCtrl which renders the scene). Oh GuiTextureCanvas does a lazy sort of culling... it has a dirty flag that is set by MatInstance::setupPass right before the texture is used. The texture always updates one frame late, but that hasn't been a problem so far.
Edited on May 21, 2005 18:10 GMT

Josh Williams   (May 21, 2005 at 18:33 GMT)
Awesome! :)

Daniel Allessi   (May 21, 2005 at 19:58 GMT)   Resource Rating: 5
Thanks for the info Tom!

Phil Carlisle   (May 21, 2005 at 20:09 GMT)
Hmmm, I really am interested in having a play with something like this for cockpit controls in my 3D cockpit, static controls are so yesterday :)

So what method did you use to create the off-screen texture you render the gui into? thats really the heart of this for me. I already know the cockpit texture to replace, so I just need a good cross-platform capable method fo render to texture that plays nice in the gui.

Zachary Zadell   (May 21, 2005 at 23:22 GMT)
That kicks so much ass.

Tom Spilman   (May 21, 2005 at 23:37 GMT)   Resource Rating: 5
@Phil - I posted the code for you on this thread.

Stefan Lundmark   (May 23, 2005 at 12:15 GMT)
Wow, that looks like so much fun! How long did it take to code, aprox?

Gabor Forrai   (May 23, 2005 at 14:34 GMT)
Kick ass video !...Congratulations !

Tom Spilman   (May 23, 2005 at 18:06 GMT)   Resource Rating: 5
@Stefan - I spent more time thinking about how to code it up than actually making the code changes and fixing my bugs. I thought about it for over a week as i wanted a solution that wouldn't require changes to critical sections of Torque. What i ended up with makes changes to TSMesh which i wanted to avoid, but once i started coding it was less than two days with bug fixes. Not alot of code either... less than a thousand lines.

Mike Kuklinski   (Oct 03, 2005 at 05:35 GMT)
I -just- saw this, and I thought I should reply, albeit late. I did this same thing, as outlined in one of my PLANs, however, I did not need to make a new class, I made an implementation that used the current guiCanvas class... it involved making a separate renderCanvas pointer, though.

John Rockefeller   (Dec 06, 2005 at 08:54 GMT)
Tom I am extremely interested in the Torque Pipeline product for the Cartography Shop. For my game, which is a racing game, I've had to create the tracks in 250m sections using the old version of Worldcraft because that's the biggest brush you can create. TCS allows you to make brushes hundreds of thousands of units big. Are Cartography Shop units the same scale as Worldcraft (ie: does 32 CS units = 1m just like WC?) Also, will you provide free updates to the Pipeline when TSE becomes more mature?

Thanks for letting me know about this, this could really save us months of piecing together little bits of highway.

-John

Doppelganger (formerly Evil Twin   (Jul 19, 2006 at 16:19 GMT)
Tom, would you care to post your code on a thread that's accessible to the TGE developers too? Seems the link above is restricted to Shader Engine folks... thanks!

Tom Spilman   (Jul 19, 2006 at 17:49 GMT)   Resource Rating: 5
@Evil - Well the code is specific to TSE. There is a resource up for it now over here but it is only for TSE users. Someone could port it to work with TGE, but i currently do not have the time to do so.

You must be a member and be logged in to either append comments or rate this resource.