Plan for Pat Wilson
by Pat Wilson · 01/19/2005 (12:44 am) · 8 comments

With the advent of panic mode on Marble Blast for the Xbox (there was some miscommunication going on and so a lot of things need to be done) I have had to move my "cool stuff in Torque" development home, and this is what I am working on. As you can see, that is a picture of one of the GuiControls I am working on. In the screenshot it is rendering a warped version of the orc (which is actually in a dynamic texture, more on that later) and it is rendering the vector-field visualization over the top of that. Though it's tough to see, the grid represents the polygons the texture is being drawn on, red dots are the vertices, green lines are the vectors which indicate how the texture coordinates are being deformed.
The DynamicTexture object is also new for 1.4, it lets you create textures and update them from either GuiControls or just screen grabs. This lets you do things like render Gui's to off-screen buffers and put them in game, like Doom 3. (I did have this idea about a year and a half ago, and I have the GarageGames resource to prove it.) I have expanded the code that I wrote back in 2003 and made it a bit more generalized for the next Torque release.
The VectorField object is new for 1.4. It is...well a vector field. It lets you do that cool warping stuff with texture coordinates. The object itself basically just holds the texture coordinate info and is used to render the quad-strips of the field. You have to set the texture on it, and tell it to use, or not use, texturing. This can probably be optimized because right now it uses one quad-strip per row, but I really don't think it's going to matter at all because the driver probably converts it to one triangle strip anyway, and even if it's not, the least of your worries when using vector-field deformation with feedback textures is batching considerations.
One of the most exciting new things I'm working on is GuiTickCtrl. This is a Gui control that works a lot like the GameBase tick processing. It is a pure virtual class that lets your control get updates every 32ms, interpolate between ticks, etc. I am using it for another new Gui control that uses the VectorField deformation stuff, because I want the warps to be at a consistent rate, not based on frame-rate.
For those of you who keep up with my Blog, sorry for the duplicate information.
Lets see if we can get GG .plans working with Technorati!
Technorati Profile
About the author
#2
whats next? glenz vectors? vectorbobs? raster bars?
01/19/2005 (5:05 am)
Its the old gel warping :) pat you demo coder you!!!whats next? glenz vectors? vectorbobs? raster bars?
#3
Now give yup the goods or Fluffy is going to get the rough treatment from the Elf-babe :)
01/19/2005 (10:09 am)
Nice Pat, this will really help in the HUD department so that we dont have flat HUDs anymore for our games. Now give yup the goods or Fluffy is going to get the rough treatment from the Elf-babe :)
#4
So i take it that the GUI controls don't get a "tick" at the moment... i did not know that.
01/19/2005 (11:40 am)
GUIs on textures could actually be useful for our game. Now i just got to hope for that merge of 1.4 into TSE. =)So i take it that the GUI controls don't get a "tick" at the moment... i did not know that.
#5
I need to write plans with more shiny things in them so I can get more people commenting on them :(
01/19/2005 (12:29 pm)
Currently nothing gets a tick unless it is based on GameBase. They get onRender every frame, but that's about it. I realize now that a lot of doccumentation probably needs to be written on what a tick is and isn't and what to use them for and what not to use them for. I need to write plans with more shiny things in them so I can get more people commenting on them :(
#6
01/19/2005 (7:30 pm)
Just to update this, I further generalized the solution and there is now an ITickable interface so in order to make an object you create recieve ticks you do the following:class FooObject : public SimObject, public virtual ITickable
{
...
virtual void advanceTime( F32 delta );
virtual void interpolateTick( F32 delta );
virtual void processTick();
...
};There's a lot more documentation in the code, but this is really useful for doing a lot of things in Torque.
#7
Nice work Pat.
- Melv.
01/23/2005 (2:20 am)
@Pat: The word useful just doesn't cut it. I'd say essential for developing custom time-based objects in TGE. *ahem* T2D.Nice work Pat.
- Melv.
#8
01/27/2005 (7:28 am)
Wow, just more cool stuff being added to 1.4 ... This really will help the Torque game interfaces come alive!
Torque Owner Jason "fireVein" Culwell
-Jase