View Full Version : TZT Effector Tutorial
Esotic
23rd February 2004, 07:39 PM
If I created a TZT Effector Tuturial would anyone here use it?
Just wondering,
-Esotic
komart663
23rd February 2004, 09:05 PM
at least you may be sure i will translate it to french :D
unjulation
23rd February 2004, 10:38 PM
sounds good even tho i dont use it, if your happy for every one to read it then get it posted on vjcentral :)
just ocured to me thinking about info and books there is a lot of good info hear, anyone ever thought about coalating it all and puting it out as a vjc-how to? mind the time it takes holly to wright a faq we could be hear forever ;)
MoRpH
23rd February 2004, 10:58 PM
Originally posted by Esotic
If I created a TZT Effector Tuturial would anyone here use it?
Just wondering,
-Esotic
For sure mate, but make sure you cover the BASICS of the programming too, make it REALLY simple to begin with... some of us have tried programming b4 and failed miserably :P
Fullscreen
27th February 2004, 01:48 AM
Originally posted by Esotic
If I created a TZT Effector Tuturial would anyone here use it?
Just wondering,
-Esotic
you're full of great ideas :D
jimmyc
29th February 2004, 08:21 PM
that would be awesome.. im about to download some of your source code you have available and try to piece it together myself- i'd love to have a tutorial though
Esotic
1st March 2004, 02:45 PM
The code that's on the website is kinda old. I'm gonna post source for all the effectors as soon as I can get around to Zipping it up.
I'll include a basic tutorial to help get people started, but will probably not get too much into programming basics as you could write books about that. But I'll get into the core issues so that maybe even non-programmers can give it a whirl.
Shoop, Shoop-A-Doop,
-Esotic
Esotic
2nd March 2004, 12:28 AM
I put source code for all my effectors on my website. Here's a few tips/tricks you may need to know.
1) Install Visual C++
2) Install the http://www.microsoft.com/downloads/details.aspx?FamilyID=124552ff-8363-47fd-8f3b-36c226e04c85&DisplayLang=en Directx SDK
3) Check to make sure the DirectX Lib and Include directories are listed in your C++ directories options.
4) Edit the last tab under "Project->Settings" to copy compiled DLL's to the appropriate TZT directory (\tzt\effector\bank0\f5 by default).
The main logic is in the Effect sub and I suggest you start there. Other noteworhy subs are SetFader, SetFaderEx (they respond to CTRL and CTRL-SHIFT key comination), and Start.
All these effects were based off the TZT template effector, so all the comments are in Japanese. :)
I expect some of you to have questions, so fire away. And please excuse anything you might think of as "sloppy coding". I work quick and dirty.
Ya Nilla,
-Esotic
http://esotic.com
PiedPiper
2nd March 2004, 04:22 AM
YAY, this sounds great!
I have just stared working as a programmer - working on building image processing software to bu used with multiple underwater camera's...
So i think i am in a good position to try some and do some work on these tzt effectors......
Sadly i only have net access at work atm. but hopefully i will fix that up soon, and then i can get started on new effectors!!
Keep up the good work Esotic!
MoRpH
2nd March 2004, 05:34 AM
OH YEAH.... now this ball is getting rolling :) good to see some more aussies getting involved :)
Esotic
2nd March 2004, 04:21 PM
I'm guessing that noone noticed my blunder, but the main page of the website wasn't pointing to the proper files. That has been fixed.
If you're inclined to jump right into the code of an effector you know and love then skip all this and get right on it. If you're looking for an easy path to effector enlightenment I would like to suggestion the following.
Start with the most basic effector, InputOnly. It doesn't really do anything except remap the input surface onto the output surface. One thing to note is that the surface arrays *(table[y]+x) are zero based, so the loops run from 0 to 319 and 0 to 239 (320x240). The array elements (table[y]) reference the memory address that begins each y line of the surface, and the +x is added to that to reference the x offset of that line.
Once you get a basic understanding of how an effector operates I would suggest looking into the Mirrors2 effector. This one may twist your brain a little more than InputOnly, but is still only modulating dimensions/geometry instead of colors. As an excercise I would suggest copying this effector and making your own mirror types. Then you should send me the code so I can use it in my shows. ;)
Next, jump on over to the MaskBlender (Mask) effector. This effector will demonstrate loading the mask Bitmaps and pulling the pixels apart into thier individual colors and then putting them back again via the blend3 procedure. The pixels are RGB565, which means 5 bits for red, 6 bits for green, and 5 bits for blue.
And finally hit the dots effector to see examples of converting RGB to HSB and back again. Be sure to look at the initmap procedure, which sets up an array for remapping RBG values. When the CTRL key is pushed the initmap calculates all translated RGB values for each RGB value thereby reducing the work per frame by not translating each pixels RGB value to HSB and then back again.
Eventually all this info will go into the tutorial, but I just wanted to get it out in the open for those that are early starters.
Math Hurts My Brain,
-(e-'s?-tik)
http://esotic.com/media/EsoticSourceCode.zip
Extra Credit Reading:
In the Effect sub you'll see a variable called pitch which is the actual width (x) of the surface. DirectX surfaces are width bound to regular values to increase thier speed in transfer through memory buses (i think that's why). So the pitch of the surface is greater than it's usable width, but we just ignore the extra bits. Surfaces are stored contiguously in memory. The memory addresses of a surface don't appear to change during an effectors life cycle, but the *(table[y]+x) arrays are reestablished for every frame. The TZT sample code was built that way so I just went with it. Look into the SetInputSurface and SetOutputSurface to see the surface objects being set for internal reference. A surface must be unlocked before reference, and then Locked after reference. You will see this being done in the Effect procedure. If an effector is in the end slot (up arrow) the input surface and player surface are the same. Trying to unlock the same memory space twice will cause an error, so bool bInIsPlayer tracks this condition.
DllExport int SetInputSurface(LPDIRECTDRAWSURFACE7 in,LPDIRECTDRAWSURFACE7 player){
if (in == player) bInIsPlayer = true;
if (!bInIsPlayer) g_EffectorVariables.lpddsIn=in;
g_EffectorVariables.lpddsPlayer=player;
return 1;
}
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.