Game Development Community

The interior render tools

by Matthew Jones · in Torque Game Engine · 06/02/2002 (9:51 am) · 15 replies

I am having a problem getting these tools plugged-in to my engine.
The instructions don't match my code. This is the problem.
1. In /example/common/client/canvas.cs
after this line:
   exec("~/ui/RecordingsDlg.gui");
add:
   exec("~/utilities/utilMenuDlg.gui");
I do not have this line in my CANVAS.CS exec("~/ui/RecordingsDlg.gui");

So obviously I can't change the code the way the instructions imply.
Here is my code:
// Common GUI's
   exec("~/ui/GuiEditorGui.gui");
   exec("~/ui/ConsoleDlg.gui");
   exec("~/ui/InspectDlg.gui");
   exec("~/ui/LoadFileDlg.gui");
   exec("~/ui/SaveFileDlg.gui");
   exec("~/ui/MessageBoxOkDlg.gui");
   exec("~/ui/MessageBoxYesNoDlg.gui");
   exec("~/ui/MessageBoxOKCancelDlg.gui");
   exec("~/ui/MessagePopupDlg.gui");
   exec("~/ui/HelpDlg.gui");

   // Commonly used helper scripts
   exec("./metrics.cs");
   exec("./messageBox.cs");
   exec("./screenshot.cs");
   exec("./cursor.cs");
   exec("./help.cs");
Where should I put the line?
Am I missing somthing?
Any help would be appriciated.

#1
06/02/2002 (9:55 am)
Maybe you're using the Torque Release_1_1_1 and the line wasn't there back then?
But it doesn't really matter where you put it (and these tools don't have anything to do with the recording stuff), so just put this line at the end of the function e.g.
#2
06/02/2002 (11:02 am)
Exactly...place it right at the end of the common group.
#3
06/02/2002 (11:21 am)
WOW that was fast. Thanks
I wasn't really sure I figured I better ask if I couldn't even get past step one. LOL

One more question for either one of you. I thought I had had the most up to date version. But its becoming apperent to me that I am missing somthing. In the instructions for the tools instruction #6 references lines for 306,and 316 I don't have them.

Could you guys tell me what I got wrong here? What is the latest version. I think I am running _1_1_1.

Thanks again
#4
06/02/2002 (12:31 pm)
Well, as far as I know, these tools should also work with Release_1_1_1 (which isn't the latest, it's about like 3 or 4 months old now, however, it was the latest precompiled release, but you can get the engine source (which changes almost every day) via CVS - see the CVS links on the left).
Anyhow, don't rely on these lines stated in the readme, simply search for the code snippits they refer to, e.g. search for "showInterior();" and change it as explained...
Oh, I just realized that you won't get it to run with the Release_1_1_1 version, 'cause you have to change some engine source, too, and recompile it... so you better go and get the CVS stuff... ;-)
Good luck!
#5
06/02/2002 (12:50 pm)
Ahh yes.
I am starting to peice the puzzle together.
Thanks alot
#6
06/02/2002 (3:17 pm)
OK so i got the whole thing done but it doesn't seem to work. So just make sure before I go back and redo everything I am supposed to use f5 at some time and I will get a menu. Then I can follow the tutorial on this page:holodeck.st.usm.edu/vrcomputing/vrc_t/tutorials/editing/
Or am I still missing somthing?
#7
06/02/2002 (3:22 pm)
Yep, that should be it... try starting the torqueDemo_DEBUG.exe -console
and see if it prints out any errors in the "dos box"...

Did it compile without errors, and everything else is fine?
#8
06/03/2002 (9:36 am)
Thanks Stefan for following up on this. :)
#9
06/03/2002 (12:05 pm)
Yup, no prob! :-)
#10
06/03/2002 (3:25 pm)
I have managed to get the settings to work when I enter them into the console. "SetInteriorRewndermode()" but I am still having trouble bringing up the GUI.
I can't remember the exact error but it says somthing to the effect that it cant open the "utilMenuDlg" I am not sure if it fails to open the ".cs" or the ".gui". I suspect the ".gui" though. I have all the files in the utilities folder. Any clue? I guess I'll get it sooner or later.
I will put the excact error up as soon as I recompile and try again. If I need to that is.

Thanks for all your help so far.
#11
06/03/2002 (7:37 pm)
Matthew,

Without the exact error message, I would only be taking a stab at the problem you are encountering. So, what I did was, I did a checkout of the Release_1_1_1 version and then modified the readme.txt file for that version. I ran through the instructions exactly as written and I did not encounter the problem you are having.

Below is the updated readme.txt file:

Installing utilities for metrics and interiorRender to Torque

1. In /example/common/client/canvas.cs

after this line:

	exec("~/ui/HelpDlg.gui");

add:

	exec("~/utilities/utilMenuDlg.gui");


2. In /example/common/main.cs

after this line:

	exec("./editor/editor.cs");

add:

	exec("./utilities/utilMenuSetup.cs");


3. In /example/common/help

	Place the file named "11. Utilities.hfl"

4. In example/common/utilities (make the directory if it doesn't exist)

	Put:

		utilMenuDlg.gui
		utilMenuDlg.cs
		utilMenuSetup.cs

5. In example/common/client/metrics.cs

Change the below line (55) from:

	"  INT: " @ $Matrics::Interior::numTexturesUsed @

to:

	"  INT: " @ $Metrics::Interior::numTexturesUsed @

Comment out the below line (141):

	GLEnableMetrics(true);

After the below lines (149-150):

	if (%cb !$= "")
	{

add:

	GLEnableMetrics(true);

6. In example/fps/client/scripts/default.bind.cs

Change the below line (310) from:

	showInterior();

to:

	metrics("interior");

Change the below line (318) from:

	show();

to:

	metrics();

7. In engine/dgl/gTexManager.h

Change the below line (288) from:

	U32 useName = tex->texGLName;

to:

	U32 useName = object->texGLName;

8. In engine/interior/interior.h

Uncomment the below line (658):

	//   void debugShowVertexColors(MaterialList* pMaterials);

9. In engine/interior/interiorDebug.cc

Uncomment the below line (139):

//      debugShowVertexColors(pMaterials);

Replace the entire function Interior::debugShowVertexColors (730-759) with the below:

void Interior::debugShowVertexColors(MaterialList* /*pMaterials*/)
{
   static U8 colors[14][3] = {
      { 0xFF, 0xFF, 0xFF },
      { 0x00, 0x00, 0xFF },
      { 0x00, 0xFF, 0x00 },
      { 0xFF, 0x00, 0x00 },
      { 0xFF, 0xFF, 0x00 },
      { 0xFF, 0x00, 0xFF },
      { 0x00, 0xFF, 0xFF },
      { 0x80, 0x80, 0x80 },
      { 0xFF, 0x80, 0x80 },
      { 0x80, 0xFF, 0x80 },
      { 0x80, 0x80, 0xFF },
      { 0x80, 0xFF, 0xFF },
      { 0xFF, 0x80, 0xFF },
      { 0xFF, 0x80, 0x80 }
   };

   glDisable(GL_TEXTURE_2D);
   glBlendFunc(GL_ONE, GL_ZERO);

   for (U32 i = 0; i < sgActivePolyListSize; i++) {
      const Surface& rSurface = mSurfaces[sgActivePolyList[i]];

      glBegin(GL_TRIANGLE_STRIP);
      for (U32 j = rSurface.windingStart; j < rSurface.windingStart + rSurface.windingCount; j++)
      {
         const ItrPaddedPoint& rPoint = mPoints[mWindings[j]];
         glColor3ub(colors[sgActivePolyList[i]%14][0],
                    colors[sgActivePolyList[i]%14][1],
                    colors[sgActivePolyList[i]%14][2]);
         glVertex3fv(rPoint.point);
      }
      glEnd();
   }

   if (smFocusedDebug == false) {
      glColor3f(0, 0, 0);
      for (U32 i = 0; i < sgActivePolyListSize; i++) {
         const Surface& rSurface = mSurfaces[sgActivePolyList[i]];
         lineLoopFromStrip(mPoints, mWindings, rSurface.windingStart, rSurface.windingCount);
      }
   }

   glEnable(GL_TEXTURE_2D);
}

10. In engine/audio/audio.cc

Comment  out the below lines (14-16):

	//#ifdef DEBUG
	//   #define GATHER_METRICS
	//#endif

11. In order for the metrics to get calculated, you will need to add the Preprocessor definition:

	GATHER_METRICS=2

	For MSVC you can follow the below steps:

		1) From the menu, select Project->Settings
		2) Make sure that Torque Demo is selected in the TreeView on the left
		3) On the tabbed dialog box select the C/C++ tab
		4) In the Preprocessor definitions field add the below to the end of the line:

			,GATHER_METRICS=2

12. You should now "clean" (from the MSVC menu Build->Batch Build->Clean) your work area and perform a full build (from the MSVC menu Build->Batch Build->Build).

13. Enjoy!  Desmond Fletcher and Richard O'Brien; special thanks to Daniel Nielsen.

Rich
#12
06/03/2002 (8:57 pm)
Cool Rich, you da man!
#13
06/03/2002 (9:21 pm)
Ya I got it working. It was the gather_metrics thing.
I didn't know what part (the Torque demo) to put the gather_metrics. So I put the command behind all of the files.
The read me that comes with the download doesn't tell you that.

Thanks you guys. I am sure I got boat load more questions for you in the future.LOL
#14
06/04/2002 (2:29 am)
Matthew,

Making sure that the Torque Demo is selected in the TreeView on the left (from step 11, sub-step 2) was not in the original readme.txt supplied with the download. That was my fault. I have not done a full checkout since I purchased the Torque engine, so I had forgotten that the Torque Demo was not selected by default. Sorry for the problems that caused you.

I also added a new step (#10) to get rid of a compiler warning when do you a full build.

Thank you for using the code!

Rich
#15
06/04/2002 (10:23 am)
Well Thanks for letting me use it.
The thing great and pretty much a vauleable asset to making levels as far as as I am concerned. I don't have much of a need for the landscape. Most of my levels are going to be interior type.

Thanks agaion for all the help.