Game Development Community

dev|Pro Game Development Curriculum

TLK CG Water + DRL

by Thanhda Tie · 06/01/2006 (8:38 am) · 96 comments

Download Code File

This Resource is a Combination of Alex "Delerium" Scarborough's DRL 2.0 Resource and Manoel Neto TGE Water upgrade Resource. I just decided to put them both together to make people's lives a little bit easier. This Resource contains all the little bug fixes that occured, and has been fully tested and working with TLK 1.4

All you need to get this to work is a TLK 1.4, and the cg tool kit which can be located at: http://developer.nvidia.com/object/cg_toolkit.html

Important: you also need to open cgGL.h in the "Cg/include" folder and replace this:

#include
By this:

#include

Otherwise you'll get loads of compile errors.

To Fix the the wierd editor bug, modify the following file in /creator/editor/EditorGui.cs

function EditorGui::onWake(%this)
{
   optimizeDRL(true); /*add*/
   MoveMap.push();
   EditorMap.push();
   %this.setEditor(%this.currentEditor);
   
   if (DemoEditorAlert.helpTag<2) Canvas.pushDialog(DemoEditorAlert);
}

function EditorGui::onSleep(%this)
{
   EditorMap.pop();
   MoveMap.pop();
   optimizeDRL(false); /*add*/
   resetDRL();             /*add*/
   $Server::CurrentScene.open();
}

-------------------------------------

Fix Update, CG Water Clipping Plane bug
Code by: David Laurie

In sky.cc change the top of Sky::Render to look like this:

void Sky::render(SceneState *state)
{
   PROFILE_START(SkyRender);
   F32 banHeights[2] = {-(mSpherePt.z-1),-(mSpherePt.z-1)};
   F32 alphaBan[2] = {0.0f, 0.0f};
   F32 depthInFog = 0.0f;
   Point3F camPos;
   S32 index=0;

   if(gClientSceneGraph)
   {
      F32 currentVisDis = gClientSceneGraph->getVisibleDistanceMod();
      if(mLastVisDisMod != currentVisDis)
      {
         calcPoints();
         for(S32 i = 0; i < MAX_NUM_LAYERS; ++i)
            mCloudLayer[i].setPoints();

         mLastVisDisMod = currentVisDis;
      }

		//  krimzon - PRLD_WATER_SHADER
		if (gClientSceneGraph->mReflectPass)
			glDisable(GL_CLIP_PLANE0);
		// -krimzon
   }

And at the bottom of the same function:

//  krimzon - PRLD_WATER_SHADER
	if (gClientSceneGraph)
	{
		if (gClientSceneGraph->mReflectPass)
			glEnable(GL_CLIP_PLANE0);
	}
	// -krimzon

   PROFILE_END();
}

For information on script usuage or for more detail, check out the original resource
Water: www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10357
DRL 2 : www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10232

In short, copy paste and compile.

FOR FULL DOCS OR SUPPORT PLEASE VISIT THE ORIGINAL RESOURCE.

Good Resource to check out:
Mission in main menu GUI 1.4
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10668
Page «Previous 1 2 3 4 5 Last »
#1
05/31/2006 (2:14 pm)
Well done. I got the water resource working about a week ago and have been looking through the DRL (original) and 2.0 resources. This should save me a few hours with WinMerge. Thanks!

edit: By the way, your screenshot is currently busted. The website its hosted on reports:
403 Forbidden
You must supply a local referer to get URL '/water3.jpg' from this server.
#2
05/31/2006 (3:40 pm)
Ah, i see. i'm doing url forwarding currently.

Here's Direct URL : http://e2g.50webs.com/water3.jpg

Also Make sure you make a back up of your project folder first in case something goes wrong.
#3
05/31/2006 (10:33 pm)
T Squared: As was mentioned in the DRL2.0 readme you may not put up the DRL2.0 source code without alerting myself or Jeff Raab. This is because in agreement with GarageGames and SynapseGaming DRL may not be distributed except as a private resource to TLK owners. Please contact GarageGames (I usually email Stephen Zepp, stephenz@garagegames.com) and ask them to lock off this resource so that only TLK licensees may download it.
#4
05/31/2006 (10:41 pm)
okay, sure thing Alex. i didnt read the Readme so i didnt know about this. Sorry for the inconvience. I have just fired off an email to Stephen so it should be getting locked to TLK asap. thanks for the heads up.

edit:
it was in the "Future DRL development.rtf" file not the readme :P but again, sorry for not getting in contact with you first.

BTW I have removed the download file from the resource until the resource is locked to TLK.
#5
05/31/2006 (10:52 pm)
@T Squared: The readme is your friend :) . Now that that's taken care of, there are a couple of other issues you should know about.

1) You forgot to include the bug fix patch available for download in the comments of DRL2.0. Without that, the bloom breaks on ATi cards, and on cards that don't support rectangular textures.

2) Those changes I put up in the comments to make it work with the water are required, don't comment them out. It still *looks* like it's working, but it will not adjust properly.

3) Only half of the changes I made to the water made it into your resource. The shader looks good, and you disable all the TU3 stuff, but you never actually activated the TU3 stuff. Might want to fix that.

I think that's about it.
#6
05/31/2006 (10:58 pm)
Alright cool. ya, i will be making those updates and bug fixes. But as i mention, i took down the download for the resource until it is locked to TLK. I should have all those bug fix as you mentions in and ready by the time they get my email. again thanks for the heads up.
#7
05/31/2006 (11:01 pm)
T Squared: You should have the download up before it gets locked off. Once it gets locked off, putting up a new download undoes the locking stuff.
#8
05/31/2006 (11:04 pm)
Code Has been updated. and ya, it looks much better now too.
#9
06/01/2006 (12:47 pm)
Awesome. I was getting sick of merging the two over and over.
#10
06/01/2006 (1:01 pm)
After this resource I am having alot problem. It compile ok but when load a mission file I have problems.

Red and Green Squares
Some huts have pink square
Nothing stay in place, the heath bar slide down, any gui silde down
The fonts in the Console is unreadable.
The game will not exit.
#11
06/01/2006 (1:52 pm)
you sure its a clean build? i will go test this resource right now on a clean build to see if there any problems.
#12
06/01/2006 (1:59 pm)
Sorry, but I just don't see the validity of this. I was able to get the awesome DRL 2.0, cg water, AND cg interiors all working well together within about 30 minutes. Merging and reposting 2 resources, both of which are quite new, seems 'wrong'. Redoing an ancient resource, bringing it up to 1.4 standards is cool, but this just isn't.
#13
06/01/2006 (2:09 pm)
@Michael Prewer
I have just tested it, it works perfectly fine. Try building in on a clean TLK 1.4 build

@Erik Madison
Unfortuantly, not everyone is as skilled of a coder as you. And some people don't want to have to deal with the hassel of merging code. You may not find this merging resource usefull, but some people may.
#14
06/01/2006 (3:24 pm)
Thanks for reply. I try on a clean install. I get same effect but worst on clean install. Do you think gamma has something do with it?
#15
06/01/2006 (3:45 pm)
Have you tried just the DRL or the CG water. try them alone first and see what happens, if you still get errors, post in there original resource, and see if they can help you out.
#16
06/01/2006 (3:48 pm)
Does it work on ATI cards?
#17
06/01/2006 (3:52 pm)
Ya it works on an ATI Card, i'm running on an ati myself
#18
06/01/2006 (4:18 pm)
@Erik: This is a valid resource. Trust me. I've lost track of how many people have asked for help integrating DRL and the Cg water. It'll be nice to just direct them to this resource.

@T Squared: Have you emailed Manoel? He might want to know about this if he doesn't already.
#19
06/01/2006 (5:03 pm)
The cg water work good, it seem to be the DRL 2.0.
#20
06/01/2006 (5:03 pm)
@Alex "Delerium" Scarborough
No, not yet, but I will be emailing Manoel tonight to let him know about this resource. Right now trying to fix this little small scripting bug. Currently the playGui.gui script is messing up the DRL. still giving it the bloom effect, but not reacting properly. I've tested this resource on the Combo pack 2, and the DRL is working properly with that. but the water reflections aren't working so well. i'm going to be taking a closer look at both there playGui.gui to pin point the problem, and try merging them together. But alex if your playgui is working correctly, would you mind posting it online.
Page «Previous 1 2 3 4 5 Last »