Game Development Community

Modernization Kit Beta Thread 2

by ArmedGeek · in Torque Game Engine · 06/28/2007 (3:46 am) · 344 replies

I think it is way past time to create a new thread for MK.

The original thread can be found here www.garagegames.com/mg/forums/result.thread.php?qt=58532

Modernization Kit website : tmk.superiorcode.com/
Username: torqueUser
Password: tMK60152
#281
07/26/2008 (9:07 pm)
Theoretically this thread and the other TMK thread should be the only places to get the url, username, and pass for the download.

What's even more disturbing is that it is possible to find a lot of old Garagegames products (and even some of the new) on some "questionable" foreign websites. Which means that probably more than one community member has broken the EULA on over half of the contents of the GG Store.
#282
07/26/2008 (9:13 pm)
Almost all EULAs get broken at one point or another... It's sad really.
#283
07/29/2008 (6:10 am)
I am having an issue that I hope someone here can help with.

I copied the 1.5.2 MK to a clean TGE 1.5.2. Dealt with the typical compiling issues and that part is good. Run demo, all looks great. Run starter.fps (just the stronghold mission for now) and water looks the same as TGE.

I poked around and discovered the water block is different from Demo. So I updated the water block in stronghold to match the demo. Still no good. No reflection, it looks like standard TGE water.

I have tried deleting DSO's a thousand times. :) Here's some screens to show what I mean.

Demo:
www.nutrigames.com/torque/demo_nice_water.jpgStarter.fps:
www.nutrigames.com/torque/fps_no_reflect.jpg
Can someone point me in the right direction on this?

Thanks,
Josh

EDIT: I decided to load the demo mission file in starter.fps. And... after falling through the floor :) I used the camera to move around and discovered the water issue was still there. So the problem appears to be in the starter.fps scripts rather than the mission file.

Any thoughts on where the problem could be?

NEVERMIND! I got it. Here's the solution in case anyone else struggled as I did:
Compare these two files:
example/demo/client/default.cs
example/starter.fps/client/default.cs

Lines 76-77 in the demo version has this:

$pref::Water::reflectionSize = "1024";
$pref::Water::Refract = "1";

Add that and you're good. Tada!
#284
07/29/2008 (7:09 am)
Did you copy the Shaders folder into the starter.fps mod? There were also a few script changes that will have to be ported over to the starter.fps scripts.

Another thing - make sure your waterblock contains these settings:
NormalMapTexture = "game/data/water/noise02.png"; //location varies
UseShader = "1";                       // if 0 then water shader is off
ReflectionSize = "512";              // defaults to 0, could be 256, 512, or even 1024
Refract = "1";                             // if 0 then refraction shader is off
#285
07/29/2008 (2:59 pm)
Thanks for the reply. The shaders are in their own folder and specified by the common scripts so those are fine without any changes. I did forget the waterblock settings and needed the script change in default.cs that I mentioned in my edit above. All is well now. Thanks!
#286
07/31/2008 (6:45 pm)
This rules
#287
07/31/2008 (7:46 pm)
Is this all from the base MK or has someone created a new resource with all of the updates?
#288
07/31/2008 (8:38 pm)
How do i use Cg water shaders with this?

i got the Cg water shaders from the Cg water mod
it looks a little better with large WAVES
i need a water shader that looks good with huge waves
#289
08/19/2008 (9:20 pm)
Hello,
I've have just got this up and running and have a few basic questions, I hope someone can answer them for me.
Q1: I'm looking at one of my autogenMatList.cs files and can't figure out what's really going on. texture[0] is always "LightMap", what is that? where is Lightmap coming from? same thing with the fog, texture[3]. textures[1] and [2] make sense because I can see the textures.
Q2: Where are these samplers[0-3] coming from? Are there more?
Q3: I'm trying to get this effect where bloom is on and off in the distance the world has a hazy effect. Is there such a thing and what to do to achieve it?
Q4: how do you use the blur?
Q5: My fog is all messed up now, before Modern conversion, how to I get it back?

Thanks a bunch for anyone who can help.
#290
08/22/2008 (7:29 am)
Well I've managed to figure out Q3 and Q4, they are both used together. When you increase the setBloomMultiplier that will increase the blur in your game, obviously you don't want too much.

We had the lighting in our game set to exactly how we want by NOT using the sun and by using a combination of baked in lighting for the dif's and light datablocks. When I merged the Modern Kit it through all the lighting out the window and have some really bizarre effects. Is there a way to turn that off? Thx.
#291
08/22/2008 (2:59 pm)
Ok, here goes.

Q1: Lightmap is the internal baked lightmap. It is used on the interiors. If you want more info, you might want to look at the corresponding shader in the '/shaders' folder. I guess it must be one of the parallax mapping shaders - which one is actually used depends on your graphics card.

Q2: You can technically use as many samplers as you please. The auto-shader generation in the interior rendering code sets a maximum of 16 samplers. You can add more samplers. All you need to do is define the sampler in the material script, using samplers[i] = . Where i represents the sampler number. Then you'll have to bind the corresponding texture file in the textures[] array below (make sure the indices match). You can then use the sampler inside the shader, by declaring a variable of the type

uniform sampler2D <mySamplerName>

Where was the name used earlier.

Q5: The question is pretty vague IMO. Could you provide more details? What exactly is happening? Link to console.log etc?
#292
08/22/2008 (4:12 pm)
@Koushik
Yeah, Q5 is weird, it has completely vanished visually so when my player starts running towards the fog the player and only the player starts to fog out, turn gray meanwhile everything else seems clear......?

Now with Q1, what if there some textures that I want to have shaders and some that I don't? Does the texture setup have to be in that specific order? If I change any of the autoGenMatList.cs files it just get's rewritten anyways?

For eg. Can I have these different setups?:
new Material(){
   // no shaders no lighting just the default interior with baked in lighting all ready to go
   mapTo = "game/data/arena3/MARBLEWALL";
   textures[0] = "game/data/arena3/MARBLEWALL";
};

new Material(){
   // no additional lighting
   mapTo = "game/data/arena3/BURNTWALL";
   Shader20 = InteriorParallax20;
   textures[0] = "game/data/arena3/BURNTWALL";
   textures[1] = "game/data/arena3/BURNTWALL_height_auto";

   samplers[0] = "BaseTexture";
   samplers[1] = "NormalMap";
};

What does the texture[3] = "Fog"; do? What would be the process of adding more texture attributes? I know that's a big question, I'm new to shaders so anything to point me in the right direction is greatly appreciated.
Thanks for your help.
#293
08/24/2008 (9:14 pm)
Trying to merge MK build 0010 for 1.5.2 into my existing TGE 1.5.2 install (that compiled perfectly before the merge) and I'm getting two persistent errors during compile.

The first:

fatal error C1083: Cannot open include file: 'platformWin32/gllist.h': No such file or directory c:\(PathInfo)\platformWin32\d3dgl.h 10

Neither my modded engine code nor the clean 1.5.2 codebase have a file named "gllist.h" in platformWin32. The lib\opengl2d3d directory does contain the relevant file. However, if it's copied over and added to the project, d3dgl.cc blows up with over a hundred errors, most of them relating to string conversion issues (char to LPCWSTR) with OutputDebugString, along with a ton of undeclared identifier complaints for about half of the contents of D3DGL_Init. I've tried enabling multbyte character support (I'm working in VC++ Express 2008 on XP SP3) in case that's the issue (and tried adding "#define _MBCS" to d3dgl.cc) but the same typecasting errors relating to OutputDebugString persist.

Interestingly, before trying to merge in the MK code I had no trouble at all compiling the engine, and it doesn't look like there should be one now.



The second:

fatal error C1083: Cannot open include file: 'vecLib/vecLib.h': No such file or directory c:\(PathInfo)\math\mMathAltivec.cc 5

Another search through the clean 1.5.2 codebase turned up nothing, and a Google search turned up info on a "vecLib Framework" over on Apple's developer documentation site. Given that I'm not using or targeting OSX, I'm tempted to comment out the include and take my chances.

Has anyone else run into this?



EDIT:

I corrected part of the errors in d3dgl.cc I was getting once I put gllist.h into the platformWin32 directory.I was getting a ton of what are basically typecasting errors and couldn't force the compiler to use MBCS to compensate (read: enabling multibyte char support did nothing to fix the sea of error C2664s), I changed all instances of OutputDebugString to OutputDebugStringA, and also changed a couple Registry key check calls from wide to ANSI and that took care of that.

However, I'm still getting a ton of these from d3dgl.cc:

Error	2	error C2065: 'gluErrorString' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9466
Error	3	error C2065: 'gluGetString' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9467
Error	4	error C2065: 'qwglCopyContext' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9817
Error	5	error C2065: 'qwglCreateContext' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9818
Error	6	error C2065: 'qwglCreateLayerContext' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9819
Error	7	error C2065: 'qwglDeleteContext' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9820
Error	8	error C2065: 'qwglDescribeLayerPlane' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9821
Error	9	error C2065: 'qwglGetCurrentContext' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9822
Error	10	error C2065: 'qwglGetCurrentDC' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9823
Error	11	error C2065: 'qwglGetLayerPaletteEntries' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9824
Error	12	error C2065: 'qwglGetProcAddress' : undeclared identifier	c:\(PathInfo)\platformWin32\d3dgl.cc	9825

(Note: Only some of the 56 errors are listed for brevity.)
#294
08/25/2008 (2:38 pm)
Update:

I got it to compile properly by dumping it into a vanilla copy of 1.5.2. Unfortunately this means having to reinstall a metric backside-load of extra stuff I had in place and working. Oh well, if 3D Realms can start over 23048734 times, once shouldn't hurt me.

(Side note: I left the previous post intact just in case anyone else has similar issues.)
#295
08/28/2008 (6:05 am)
How do I turn off the feature that keeps re-writing these files: autogenMatList.cs. The kit has created those files, which is wonderful, but now I would like to customize some of the materials without my work being over written with the default autogenMatList.cs?????
I've noticed in a few posts to comment out the #define MK_AUTOGEN_MATERIALS but when I do that there are no textures showing up in the game, it just shows the polygons with some crazy rendering? I even tried commenting out the call to the generateMaterial function and it has the same no texture crazy polygon look.
How are these auto gen files being exec'd? If I could just manually exec the autogen files myself that'd be perfect. Any suggestions?
Thx.
#296
08/28/2008 (10:12 am)
@ DALO

About your previous post: You cannot do that. If you want to have your models look like no shader was being applied to them, I suggest writing a shader to replicate fixed function rendering. This is a result of the way in which the MK handles interior rendering.

Second post:
If you, comment out that #define, you'll need to specify all of the materials manually. Now, autogenmatlist.cs will NOT be executed by the engine, following the fact that it doesn't look to generate normal maps on the fly.

To solve this, first run it in auto-normal map mode, so that autogenmatlist.cs is created. Then comment out the #define, and make a copy of the autogenmatlist.cs file. Now, add a call to exec() that cs file separately. That way, you will have some material definitions to work with and these will not be over-ridden by the engine.

And yeah, regarding the increase in texture units, it is possible. First, to your material script, in the material definition, add to the samplers array and the textures array. Then you can allocate and gain access to another sampler variable. You can then use this variable to access another texture variable.

Using it would need some knowledge of GLSL though. You might want to start Here
#297
08/30/2008 (7:51 am)
@Koushik,
Thank you very much, that worked perfectly ;-)
@ anyone
Most of the textures that have shaders applied to them all look like plasitc coated objects to me. Is there a quick way to make it less shiny and more rugged? Or do I have to write my own shader for that?
Thx.
#298
08/30/2008 (3:37 pm)
It has something to do with the specularity, I assume. If you're using Koushik's shader with three images (colour map, normal map, spec map), I'd assume you just make the specular map darker in the parts you want it less shiny.
#299
08/30/2008 (7:57 pm)
@Daniel, yeah I noticed that Koushik had posted a resource for dts objects to have shader's, which looks really cool. But as for the Modern Kit, how would I go about adding specularity? Does it have to be done in Engine and Script? or can it be as simple as adding an extra texture in script and that's it? For example:
...
...
textures[4] = "game/data/example/SPECULAR";

samplers[0] = "LightMap";
...
...
samplers[4] = "Specular"; // ??????
// done
Thx.
#300
08/31/2008 (6:02 am)
Specular on interiors... I think requires a rewrite of the interior shaders. Not an engine change, as far as I know. I may be wrong; I know Alex was working on interior specularity for the next release of TMK - but I don't know whether he was engine coding it, or just writing shaders.