J. Donavan Stanley - TerrainManager question..
by Brett Fattori · in Torque Game Engine · 04/05/2003 (6:15 pm) · 77 replies
Someone mentioned, back in the original thread, the complete lack of dynamic shadows once they implemented the TerrainManager. Is there something simple that I'm missing here? I am getting the same behavior with shadows not rendering on terrain. I've plowed through the code and not found what causes them to be absent.
I'm working on a helicopter simulator right now and the lack of shadows is making it difficult to know "visually" if I'm about to crash! :-)
Anyways, if you (or anyone) has a fix for this, please let me know (or point me in the right direction)...
Also, as a side note, I know that Melv was working on Waterblock implementations for use with the TM. Any progress on that??
Thanks!
- Brett
I'm working on a helicopter simulator right now and the lack of shadows is making it difficult to know "visually" if I'm about to crash! :-)
Anyways, if you (or anyone) has a fix for this, please let me know (or point me in the right direction)...
Also, as a side note, I know that Melv was working on Waterblock implementations for use with the TM. Any progress on that??
Thanks!
- Brett
#62
And to answer your question, no they're not one and the same. TerrainManagers get ghosted to the client the same way most other objects do.
04/21/2003 (1:37 pm)
First a quick note: the header is wrong that parameter should be called bClient. (I fixed the header in build 17 or 18 can't remember which).And to answer your question, no they're not one and the same. TerrainManagers get ghosted to the client the same way most other objects do.
#63
This patch modifies the fluid and waterblock objects to be TerrainManager aware. Depth textures should now render correctly across all terrain blocks.
04/22/2003 (7:15 am)
I just uploaded a build_19.patch to my personal site, it'll show up on gorpe.com later as part of the main archive and as a sepeate download.This patch modifies the fluid and waterblock objects to be TerrainManager aware. Depth textures should now render correctly across all terrain blocks.
#64
Any ideas?
- Brett
04/23/2003 (7:06 pm)
Hrmm... Did I miss something along the way, or is there a problem with lighting an TM? I seem to not be able to affect the overall light of the terrain with the sun settings. It always seems to be lighted at the default. Plus, there are no lightmaps for the terrain.Any ideas?
- Brett
#65
04/23/2003 (7:24 pm)
hmmm I'll have to look into it.
#66
In the TerrainManager, look for:
- Brett
04/23/2003 (8:12 pm)
Found it...In the TerrainManager, look for:
//--------------------------------------
U32 TerrainManager::getCRC()
{
// --- BT: Probably XOR all the CRCs of terrains together?
return 0;
}And change it to://--------------------------------------
U32 TerrainManager::getCRC()
{
// --- BT: Probably XOR all the CRCs of terrains together?
return 1;
}It works, but it's a kludge, hack, nasty workaround... Eventually, this should be properly fixed. The reason is, that without a proper CRC, it won't call the light proxy for the terrain.- Brett
#67
04/24/2003 (2:49 am)
After you do that you need to fix the call to "FindSquare" in "TerrainBlock::getNormal" to call the "pTerrManager->findSquare" or the engine will crash during lighting. I'll put this out as a patch tonight.
#68
04/27/2003 (2:13 am)
Ok. I have another Problem here. After applying the code to the engine I get an error when adding a wheeled Vehicle. The error occurs as soon as the Vehicle is getting contact to the Terrain. Do you guys have the same Problem? (To test it, just run the racing mod with Terrain Manager)
#69
I know that at one point in time TM had problems with wheeled vehicles but I've since tested and driven a car around TM based terrain without problems. Did you apply the various build_xx.patch files as well?
04/27/2003 (5:55 am)
Marco,I know that at one point in time TM had problems with wheeled vehicles but I've since tested and driven a car around TM based terrain without problems. Did you apply the various build_xx.patch files as well?
#70
I will try it on a clean Head. Just with the TerrainManager Changes as soon as I get home.
04/27/2003 (10:19 pm)
I think I've applied all the patches. But maybe I've missed one patch or a Hunk or anything. Maybe it is one of my other changes on the engine. But TerrainManager was the first thing i thought about, because it crashes when the wheels are getting contact with the terrain.I will try it on a clean Head. Just with the TerrainManager Changes as soon as I get home.
#71
I do know that if you missed the patch that enabled the shadows on terrain again you're going to have issues with vechicles becuase the buildPolys funtion wasn't implemented.
04/28/2003 (2:40 am)
Make a note of what assertion you get / what line causes the crash, if you get one.I do know that if you missed the patch that enabled the shadows on terrain again you're going to have issues with vechicles becuase the buildPolys funtion wasn't implemented.
#72
I've applied this patch. Well at least a have shadows on my terrain :) But I will look at it. Thanks for your help!
04/28/2003 (3:02 am)
Ok, I will do that.I've applied this patch. Well at least a have shadows on my terrain :) But I will look at it. Thanks for your help!
#73
04/30/2003 (5:52 am)
Sorry, was no problem :) It was just a little typo around the function. Have fixed it. Thanks again...
#75
05/12/2003 (12:37 am)
Just another question: Can I save the terrain? I was in the editor and saved it. But after reloading the mission, all was like befor. I've set the parameter in the mis file (locked) to false. But that hadn't any affect. Any thoughts?
#76
It sounds like one of the patches to the script based editors didn't take. You should check the save function in editorgui.cs and make sure it includes a call to TerrainMgr.saveTerrain()
05/12/2003 (2:40 am)
Marco,It sounds like one of the patches to the script based editors didn't take. You should check the save function in editorgui.cs and make sure it includes a call to TerrainMgr.saveTerrain()
Torque Owner Matt Bell