Lighting pack and RTS
by Guillermo Vilas · in Torque Game Engine · 09/06/2005 (5:22 am) · 5 replies
I started this thread in the wrong forum. but now here it is.
I need help trying to add the LK to the RTS SDK.
The version of the LK I have is fully integrated to the TGE SDK so I need to make no changes to the TGE but using the LK SDK by itself. But for the RTS SDK is another story and I have no documentation of the files that have to changed.
Thanks for the help in advance
I need help trying to add the LK to the RTS SDK.
The version of the LK I have is fully integrated to the TGE SDK so I need to make no changes to the TGE but using the LK SDK by itself. But for the RTS SDK is another story and I have no documentation of the files that have to changed.
Thanks for the help in advance
#2
There are a ton of really nice merge tools available, but if you're looking for a free merge tool I still recommend WinMerge, it's easy to use and has some cool features.
Did you check out the Migration Guide? It has a list of the files changed by the Torque Lighting Kit, and it explains how to merge TLK into another source (which in this case will be the RTS Kit).
Here's a quick explanation of the process (but check out the guide which has more details):
-Download and install both TLK and the RTS Kit.
-Open WinMerge.
-Goto the menu item Tools/Filters, select the Linefilters tab, and enter the following into the textbox:
(this filters out a lot of unnecessary changes)
-Next select File/Open and for both the left and the right directories to compare select Browse and find the main Torque folders for TLK (named 'LightingPack') and the RTS Kit (named 'RTSStarterKit'). I usually select TLK on the left and the other source, in this case the RTS Kit, on the right, and because we're going to move TLK into the RTS Kit all of our changes are going to move from left to right (from TLK to the RTS Kit).
-Select OK.
After the diff process completes WinMerge shows you a list of identical files, different files, files that are only on the left side, and files that are only on the right side. Basically you want to:
-Move all of the 'synapseGaming' directories that are only on the left side over (right click on the directory in WinMerge and select Copy->Left to Right - there are two, one in the 'engine' directory and one in 'example/common')
-Merge all of the changes to the right by double clicking on the changed files and scanning the differences (Alt-Down) looking for TLK code blocks, which look like this:
And merging them right using Alt-Right.
You can use the table in the Migration Guide to see which files have TLK changes in them, allowing you to skip a number of files.
09/06/2005 (10:07 am)
Nice another cool merge tool. :)There are a ton of really nice merge tools available, but if you're looking for a free merge tool I still recommend WinMerge, it's easy to use and has some cool features.
Did you check out the Migration Guide? It has a list of the files changed by the Torque Lighting Kit, and it explains how to merge TLK into another source (which in this case will be the RTS Kit).
Here's a quick explanation of the process (but check out the guide which has more details):
-Download and install both TLK and the RTS Kit.
-Open WinMerge.
-Goto the menu item Tools/Filters, select the Linefilters tab, and enter the following into the textbox:
$Id: $Header: $Revision: $Date:
(this filters out a lot of unnecessary changes)
-Next select File/Open and for both the left and the right directories to compare select Browse and find the main Torque folders for TLK (named 'LightingPack') and the RTS Kit (named 'RTSStarterKit'). I usually select TLK on the left and the other source, in this case the RTS Kit, on the right, and because we're going to move TLK into the RTS Kit all of our changes are going to move from left to right (from TLK to the RTS Kit).
-Select OK.
After the diff process completes WinMerge shows you a list of identical files, different files, files that are only on the left side, and files that are only on the right side. Basically you want to:
-Move all of the 'synapseGaming' directories that are only on the left side over (right click on the directory in WinMerge and select Copy->Left to Right - there are two, one in the 'engine' directory and one in 'example/common')
-Merge all of the changes to the right by double clicking on the changed files and scanning the differences (Alt-Down) looking for TLK code blocks, which look like this:
//----------------------------------------------- // Lighting Pack code block //----------------------------------------------- <some code here> //----------------------------------------------- // Lighting Pack code block //-----------------------------------------------
And merging them right using Alt-Right.
You can use the table in the Migration Guide to see which files have TLK changes in them, allowing you to skip a number of files.
#3
-Then change the left and right directories to 'LightingPack/example/starter.fps' and 'RTSStarterKit/example/starter.RTS', and merge the changes right again using the Migration Guide's changed files list as a reference (there should only be two or three changes this time).
-Finally add the TLK files to the RTS Kit project files (the list of files and the projects to add them to are in the Migration Guide).
I know this is a long process, but it's actually easy, though very repetitive.
I've been developing a few tools to automate the integration, so that other than running the utility you would only need to add the TLK files to the RTS Kit projects (the last step above), but they're not available just yet.
Let me know if you have any questions,
And like I said other than the one merge in terrRender mentioned above, all of the TLK changes merge cleanly and easily into the RTS Kit.
-John
09/06/2005 (10:07 am)
When you come to the last difference in terrRender.cc here's where the TLK code goes:if (mEnableTerrainDynLights && sgCurrLightTris) {
glEnable(GL_TEXTURE_2D);
//-----------------------------------------------
// Lighting Pack code block
//-----------------------------------------------
sgTerrain::sgRenderBlockLightsBegin();
//-----------------------------------------------
// Lighting Pack code block
//-----------------------------------------------
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glBindTexture(GL_TEXTURE_2D, mCurrentBlock->mDynLightTexture.getGLName());
LightTriangle* walk = sgCurrLightTris;
glBegin(GL_TRIANGLES);
while (walk) {
if (walk->flags) {
glColor4fv(walk->color);
glTexCoord2fv(walk->texco1);
glVertex3fv(walk->point1);
glColor4fv(walk->color);
glTexCoord2fv(walk->texco2);
glVertex3fv(walk->point2);
glColor4fv(walk->color);
glTexCoord2fv(walk->texco3);
glVertex3fv(walk->point3);
}
walk = walk->next;
}
glEnd();
[b]
//-----------------------------------------------
// Lighting Pack code block
//-----------------------------------------------
sgTerrain::sgRenderBlockEnd();
//-----------------------------------------------
// Lighting Pack code block
//-----------------------------------------------
[/b]
glDisable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glDisable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ZERO);
}
[b]
// above is stock TGE code!
//--------------------------------
// below is the RTS code!
[/b]
//selections...
if (sgCurrSelectionTris) {-Then change the left and right directories to 'LightingPack/example/starter.fps' and 'RTSStarterKit/example/starter.RTS', and merge the changes right again using the Migration Guide's changed files list as a reference (there should only be two or three changes this time).
-Finally add the TLK files to the RTS Kit project files (the list of files and the projects to add them to are in the Migration Guide).
I know this is a long process, but it's actually easy, though very repetitive.
I've been developing a few tools to automate the integration, so that other than running the utility you would only need to add the TLK files to the RTS Kit projects (the last step above), but they're not available just yet.
Let me know if you have any questions,
And like I said other than the one merge in terrRender mentioned above, all of the TLK changes merge cleanly and easily into the RTS Kit.
-John
#4
Thanks
09/06/2005 (1:01 pm)
Hi John I started to made the changes to the RTS Kit, I can't find Migration Guide in the unzipped folder of the synapseGaming_lightingPack-1.3.0.zip, the doc I found is the Modelers Guide. Where can I download the Migration Guide?Thanks
#5
I'm sorry that's my mistake, I thought you were using version 1.3.5 - version 1.3 didn't have a Migration Guide. If you download version 1.3.5 its Migration Guide is compatible with 1.3, however I recommend just using 1.3.5 it's been out for around four months now and is solid - plus it has a ton of extra features compare to 1.3.
-John
09/06/2005 (1:31 pm)
Hi Guillermo,I'm sorry that's my mistake, I thought you were using version 1.3.5 - version 1.3 didn't have a Migration Guide. If you download version 1.3.5 its Migration Guide is compatible with 1.3, however I recommend just using 1.3.5 it's been out for around four months now and is solid - plus it has a ton of extra features compare to 1.3.
-John
Torque Owner Karthik Krishnan