Game Development Community

Topic: Tge Water - From General Thread

by Alan James · in Torque Game Engine · 04/06/2006 (12:43 am) · 8 replies

Hi Guys again,

Thought I'd continue this here, since you have to change a line of code to get rid of the fog problem. Here is a .map file that is a mirrored surface. It should work in Quark and in Cartography, but I haven't been able to get 3D World Studio to work right with it. This one also I believe is the passable one by the player.

www.reallyreallygoodthings.com/resources/mirror01.zip

Here is a second that should work also (includes a texture and a dif file).

www.reallyreallygoodthings.com/resources/MirrorDif.zip

Now I'd only change the following if you intend on A) using mirrored surfaces B) don't need to be submerged and C) understand it will do weird things to the First Person Weapon resource, i.e. it still works fine, but all you see in the mirrored reflection is a floating weapon...that's one that I haven't figure out yet.

So the change:
Go into game.cc and *around* line 838 (that's were it's at in mine, but I've messed with a whole lot of files),
anyway in the section find -

if (WaterBlock::mCameraSubmerged)
find the line that reads
glColor4f(.2, .6, .6, .3);
and change it to read
glColor4f(.0, .0, .0, .0);

and then recompile. The reason this needs to be done, is that if you put a partially transparent water block over your reflective dif, the line of sight of the reflection passes under the water surface and therefore it looks like you're underwater when you're not.

Hope this is clear. It's kind of late. The other thing to keep in mind is that the mirror dif *has* to be resized in Quark, Cartography, etc. If you try to resize it in the Engine, it will loose it's reflective properties.

- Alan
Really Really Good Things Studio

Edit: Nearly forgot the obligatory, legislative-required screenshot -

www.reallyreallygoodthings.com/screens/screenshot_122R.jpg

#1
04/06/2006 (3:15 am)
Looks nice!
#2
04/06/2006 (9:07 am)
Nice! I will definitely have to play with this.
#3
04/20/2006 (5:30 pm)
I am using TGE 1.4 and i get a Disconnect error saying i do not have the correct version of TGE or related art to run this. shutting down. Has anyone else gotten this going. I am trying to make some water reflective in TGE.
#4
04/20/2006 (6:05 pm)
@James,

In your console.log, what texture is it saying it's missing? I probably forgot to include one of the textures with the zip/dif files. Just take a look at it, it should tell you what texture it can't find. Worse case scenario, name a texture the same name as it says it's missing and it should load, if not, post the name of the texture and I'll post a link. I'm sure that's what's happening to you.

- Alan
Really Really Good Things Studio

BTW, check out this, particularly the four screens at the bottom of the thread from *TGE*:

www.garagegames.com/mg/forums/result.thread.php?qt=33724

Hopefully He'll post it as as resource *SOON*.
#5
04/20/2006 (6:12 pm)
@Alan,

Yup, I have been following that thread and trying to figure out a way to bribe Manoel into packing that up and releasing it as a resource.

I think he is working on it...but a little more encouragement wouldn't, hurt *hint, hint*
#6
04/20/2006 (6:17 pm)
@Todd,

So what do you think, show up at his place with broads and beer? Oops, I promised my wife I wouldn't call chicks broads...

- Alan
#7
04/20/2006 (6:39 pm)
Hmmm...the nonviolent approach..it worth a shot.
#8
04/20/2006 (6:40 pm)
It will only remain nonviolent until my wife reads my post.