Modernization Kit Beta Thread 2
by ArmedGeek · in Torque Game Engine · 06/27/2007 (8:46 pm) · 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
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
#242
03/06/2008 (9:13 am)
@Nathan: Materials are actually meant to be mapped to textures. So it's closer tonew Material()
{
Shader20 = My20Shader;
mapTo = "someTexture";
texture[0] = "pathTo/diffuse/texture";
texture[1] = "pathT/normal/map";
texture[2] = "$fog";
};or somesuch like that, and then whenever "someTexture" would normally be used, the material should be substituted in.
#243
Alright, so say I make a hemispherical shader... I would only have to reference it how you show? I don't have to worry about view/world transformation setup, or anything like that? Or does this mean there is more work that needs to be done in the shader to ease it into Torque? One line question would be:
Does MK handle all the other bits, so I only have to make my shader and the material files? If so, MK is even nicer than I though. And making a node based shader editor (I haven't gotten a hands-on with TGEA, so I don't know if it has something similar) would be that much simpler. I do like my RenderMonkey and FXComposer, but an in-engine editor with mix and match snippets would be really sweet. It sounds like TGEA has this feature, but again, I haven't seen it.
So out of curiosity Alex, are you still working on MK, as far as new features? If so, care to share any? Or perhaps you're waiting to share it in a blog post... Either way I hope you plan to keep rolling with this. I haven't dove into MK quite yet, so maybe I'm hoping for something that isn't necessary :p.
PS - This thread is getting really long! We're hefty posters...
03/06/2008 (10:07 am)
Whoa, are messing with me? I read over the docs *briefly* when I first implemented MK, which I might add was pretty simple. Amazing how something as complex as shader support, was easier to install than things way simpler. So good job on ease of installation. But yeah, I didn't catch that... Or at least it didn't sink in.Alright, so say I make a hemispherical shader... I would only have to reference it how you show? I don't have to worry about view/world transformation setup, or anything like that? Or does this mean there is more work that needs to be done in the shader to ease it into Torque? One line question would be:
Does MK handle all the other bits, so I only have to make my shader and the material files? If so, MK is even nicer than I though. And making a node based shader editor (I haven't gotten a hands-on with TGEA, so I don't know if it has something similar) would be that much simpler. I do like my RenderMonkey and FXComposer, but an in-engine editor with mix and match snippets would be really sweet. It sounds like TGEA has this feature, but again, I haven't seen it.
So out of curiosity Alex, are you still working on MK, as far as new features? If so, care to share any? Or perhaps you're waiting to share it in a blog post... Either way I hope you plan to keep rolling with this. I haven't dove into MK quite yet, so maybe I'm hoping for something that isn't necessary :p.
PS - This thread is getting really long! We're hefty posters...
#244
I haven't actively worked on the MK since mid July 2007, nor do I have any plans to do so at this time.
03/06/2008 (8:28 pm)
The MK just binds your shader/texture. It relies on TGE to get the usual modelview and projection matrices to the shader (use gl_ModelViewProjectionMatrix). The water and interior renderers send up their own custom parameters, you'd have to check the code to see what they are. It isn't too hard to add your own parameters as well. In addition, the MK exposes a way to set parameters which apply to all shaders via script; take a look at ShaderManager::setGlobalParameter for more information.I haven't actively worked on the MK since mid July 2007, nor do I have any plans to do so at this time.
#245
Just the other day I toasted my machine, and have been gradually getting things back to normal... Gotta love starting from scratch. Not totally, but enough to set me back a few days. Happened while running nTune on "Coarse Tuning"... Well, my machine is definitely tuned now! Hence my ignorance to the finer details here with MK. It's funny too- I was sitting on the couch referencing Game Programmer's Guide to Torque, waiting for nTune to finish, and start diving into MK for a bit. Oh the irony...
03/06/2008 (10:22 pm)
I do remember peeking at that, and the script. I noticed you had variables for sky and ground color... Though I didn't investigate to see if you were putting it to use- I assume it was for hemispherical lighting? I did examine things closely in game, to see if I could spot the effect. At times I thought I did, but it was faint and could have been my eyes. I just realized I keep spouting on about hemi lighting... it's just so darn quick and easy, and it adds a very nice touch! So I'm a hemi lover. On top of other things of course.Just the other day I toasted my machine, and have been gradually getting things back to normal... Gotta love starting from scratch. Not totally, but enough to set me back a few days. Happened while running nTune on "Coarse Tuning"... Well, my machine is definitely tuned now! Hence my ignorance to the finer details here with MK. It's funny too- I was sitting on the couch referencing Game Programmer's Guide to Torque, waiting for nTune to finish, and start diving into MK for a bit. Oh the irony...
#246
03/06/2008 (10:29 pm)
Heh, those are probably a holdover from when I messed around with lighting models and DTS shapes waaay back in the days of 1.4. The MK automatically exports all global parameters that have been set, and I just never got around to clearing that file. I don't think the MK actually uses any of those parameters.
#247
For the past 2 hours I've been racking my brain on the DTS implementation. I just ran into a wall. I think the textures aren't being passed to the shader correctly.
I tried it out with a test shader, which discards fragments with a specified RGB value (basically discards very bright fragments and retains the darker ones). Then, I renamed the actual textures (so setMaterial() wouldn't find it), and made a reference in the material script.
If I bind the material in the C++ code, the shader is getting bound, but the textures that it receives aren't coming through. It just stays shaded (as it otherwise normally would if it didn't find a texture). I know the shader is getting bound because the fragments are getting discarded on all DTS objects, just that the textures aren't there, discarding is done on the lit model.
I've tried disabling twopass lighting, fogrendering, detailrendering and environment mapping, but to no avail.
Any ideas on how to fix this?
EDIT: Okay, got it to work... lack of sleep I guess... Now Multitexturing co-ords above the texcoord0 don't work (but then again, I could be wrong for I'm dangerously low on sleep)... Now I need to figure out where in the entire mess the material names are stored, the TextureHandle::getName() functions keep crashing the app... goddammit...
EDIT2: Nevermind...
EDIT3: Here you go... http://www.garagegames.com/blogs/106805/14417
03/09/2008 (4:19 am)
Hey Alex! Nice to know you're still lurking around...For the past 2 hours I've been racking my brain on the DTS implementation. I just ran into a wall. I think the textures aren't being passed to the shader correctly.
I tried it out with a test shader, which discards fragments with a specified RGB value (basically discards very bright fragments and retains the darker ones). Then, I renamed the actual textures (so setMaterial() wouldn't find it), and made a reference in the material script.
If I bind the material in the C++ code, the shader is getting bound, but the textures that it receives aren't coming through. It just stays shaded (as it otherwise normally would if it didn't find a texture). I know the shader is getting bound because the fragments are getting discarded on all DTS objects, just that the textures aren't there, discarding is done on the lit model.
I've tried disabling twopass lighting, fogrendering, detailrendering and environment mapping, but to no avail.
Any ideas on how to fix this?
EDIT: Okay, got it to work... lack of sleep I guess... Now Multitexturing co-ords above the texcoord0 don't work (but then again, I could be wrong for I'm dangerously low on sleep)... Now I need to figure out where in the entire mess the material names are stored, the TextureHandle::getName() functions keep crashing the app... goddammit...
EDIT2: Nevermind...
EDIT3: Here you go... http://www.garagegames.com/blogs/106805/14417
#248
03/21/2008 (4:04 pm)
Anyone make any progress with bumpmapped .dts?
#249
I have been working on bump-mapped DTS objects... unfortunately, I haven't found the time to post up images/ videos (university exams and such).
Will definitely do so in a couple of days... and post the link... still WIP though
03/21/2008 (7:58 pm)
Ha! You also drew it out of my tongue!I have been working on bump-mapped DTS objects... unfortunately, I haven't found the time to post up images/ videos (university exams and such).
Will definitely do so in a couple of days... and post the link... still WIP though
#250
Its a first version, needs loads of improvement though... :)
03/24/2008 (11:29 pm)
Here you go : www.garagegames.com/blogs/106805/14499Its a first version, needs loads of improvement though... :)
#251
On an unrelated note - is there someone who can better explain the DRL variables? Bias limits, goal intensity and the like? I like the default settings, bt when I try to change them, odd things happen (like the brightness not adjusting automatically to looking at the sun).
03/27/2008 (11:18 am)
Koushik, you are a hero :)On an unrelated note - is there someone who can better explain the DRL variables? Bias limits, goal intensity and the like? I like the default settings, bt when I try to change them, odd things happen (like the brightness not adjusting automatically to looking at the sun).
#252
06/08/2008 (4:40 pm)
Still looking forward to updates on this. Especially bump-mapped .dts.
#253
I'll be writing a .plan about it in a couple of days... I'll link it up over here... I have big plans in place for the whole thing - don't want to ruin the surprise though ;)
06/09/2008 (3:44 am)
Ok... really sorry everyone... I've had a disastrous past month and hence have been unable to put anything forth at all.I'll be writing a .plan about it in a couple of days... I'll link it up over here... I have big plans in place for the whole thing - don't want to ruin the surprise though ;)
#255


It's not an engine problem, because this isn't happening in the demo or starter.fps. I think I forgot to include some script files, but I'm not sure which ones.
Edit-> When the camera is under water, everything renders like it should, but out of water I get those wierd random transparencies.
06/23/2008 (7:58 pm)
Que???

It's not an engine problem, because this isn't happening in the demo or starter.fps. I think I forgot to include some script files, but I'm not sure which ones.
Edit-> When the camera is under water, everything renders like it should, but out of water I get those wierd random transparencies.
#256

That picture is from under the terrain, and the two above (last post) are from on top of it.
This isn't happening in the Demo or Starter.fps, just in my Arcane.FX folder.
Edit-> It has something to do with the mission, because the other missions (not using the MK) still run normally, but trying to take advantage of the water in the third has "killed" it.
Edit2 -> Confirmed that it's the water killing it; I took that out of the mission, and now it works. Now I just need to figure out how to get it back in the mission without funcky texture problems.
06/24/2008 (12:24 pm)
Still not working, but I've found out what's going on: everything (but the water) is being rendered inside-out! This is corrected if I go underwater or into the world editor, but that doesn't help to much.
That picture is from under the terrain, and the two above (last post) are from on top of it.
This isn't happening in the Demo or Starter.fps, just in my Arcane.FX folder.
Edit-> It has something to do with the mission, because the other missions (not using the MK) still run normally, but trying to take advantage of the water in the third has "killed" it.
Edit2 -> Confirmed that it's the water killing it; I took that out of the mission, and now it works. Now I just need to figure out how to get it back in the mission without funcky texture problems.
#257
06/24/2008 (8:33 pm)
Yeah... all of your normals are flipped. Check your waterblock scripts for any normal texture map changes.
#258
Here's my water block, for the most part, it is identical to the one in the demo:
Edit-> If I set 'useDepthMask' to false, the normals aren't messed up, but I get no reflection/refraction on the water.
06/25/2008 (4:46 am)
Normal texture map changes? I'm using the exact same water block from the demo (normal from the common folder), and my normals are flipped. I'm not even sure what that means, or how to fix it. I'm an idiot when it comes to graphics. =PHere's my water block, for the most part, it is identical to the one in the demo:
new WaterBlock(Water) {
position = "-1024 -1024 0";
rotation = "1 0 0 0";
scale = "2048 2048 200";
UseDepthMask = "1";
surfaceTexture = "~/data/water/water";
ShoreTexture = "~/data/water/wateredge";
envMapOverTexture = "~/data/skies/storm_env";
envMapUnderTexture = "~/data/terrains/grassland/sand";
specularMaskTex = "~/data/water/specmask";
NormalMapTexture = "common/data/water/noise02";
UseShader = "1";
ReflectionSize = "1024";
Refract = "1";
liquidType = "OceanWater";
density = "1";
viscosity = "20";
waveMagnitude = "0";
surfaceOpacity = "0.05";
envMapIntensity = "0.5";
TessSurface = "95";
TessShore = "90";
SurfaceParallax = "3";
FlowAngle = "220";
FlowRate = "0.1";
DistortGridScale = "0.1";
DistortMag = "0.1";
DistortTime = "2";
ShoreDepth = "1";
DepthGradient = "1";
MinAlpha = "0.01";
MaxAlpha = "0.75";
tile = "1";
removeWetEdges = "0";
specularColor = "0.831373 0.878431 0.890196 1";
specularPower = "15";
floodFill = "1";
params2 = "0.39 0.39 0.2 0.133";
params3 = "1.21 -0.61 0.13 -0.33";
locked = "true";
seedPoints = "0 0 1 0 1 1 0 1";
params0 = "0.32 -0.67 0.066 0.5";
textureSize = "32 32";
Extent = "100 100 10";
params1 = "0.63 -2.41 0.33 0.21";
};Edit-> If I set 'useDepthMask' to false, the normals aren't messed up, but I get no reflection/refraction on the water.
#259
FWIW, the TGE terrain polys get drawn such that their textures are face-down and/or backwards... which is annoying when you try to use letters/symbols on the ground... you end up having to flip your source texture around...
06/25/2008 (7:57 am)
I'm not sure if it matters, but the waterblock polys may get drawn with the texture either face-up or face-down... does this matter as far as the normal map goes?FWIW, the TGE terrain polys get drawn such that their textures are face-down and/or backwards... which is annoying when you try to use letters/symbols on the ground... you end up having to flip your source texture around...
#260
But I think I might have solved where my problem is coming from. The MK applies changes to gameTSControl, but I'm usinng afxTSControl, which explains why it is working in the Demo and Starter.fps, but not in Arcane.FX. The problem is that the afxTScontrol is different enough from the gameTScontrol that it might be some work getting it to work.
Edit -> Yep, I was right! I just needed to make the changes to afxTScontrol, and now it runs perfectly! Here's some screenies:
Pic 1
Pic 2
Pic 3
Pic 4
The MK does seem to make the zodiacs appear a little more blured.
06/25/2008 (8:08 am)
It's not just the water that gets drawn face-down, everything is face-down; just look at the pictures. There is no way to flip an image file like that.But I think I might have solved where my problem is coming from. The MK applies changes to gameTSControl, but I'm usinng afxTSControl, which explains why it is working in the Demo and Starter.fps, but not in Arcane.FX. The problem is that the afxTScontrol is different enough from the gameTScontrol that it might be some work getting it to work.
Edit -> Yep, I was right! I just needed to make the changes to afxTScontrol, and now it runs perfectly! Here's some screenies:
Pic 1
Pic 2
Pic 3
Pic 4
The MK does seem to make the zodiacs appear a little more blured.
Torque 3D Owner Nicolas Buquet
I'm sure your useful informations will be helpful the day I dive into this 'small' add-on to MK.
Nicolas Buquet
www.buquet-net.com/cv/