Water disappear bug/ multi zone water?
by Clint S. Brewer · in Torque Game Engine · 03/28/2006 (1:56 pm) · 5 replies
I'm trying to track down a bug where the water disappears in certain situations.
1. zoom in so your fov is small and look down at the water, turn gradually and when you are roughly axis aligned the water will dissapear.
2. water is outside a building, but the plane extends through and under the building. It crosses at one point from the outside zone to the inside zone where there is a pool of water. This was fine until we actually zoned off the inside zone, now When the portal that looks to the outside world isn't visible the inside water disappears.
I thought that problem (1) was just some sort of rendering problem where the field of view would be smaller than the blocksize and wouldn't render or something crazy like that. But in debugging, it looks like preprender image isn't even getting called for the water in both situations.
For problem 2 it seems that what I want to do is have the water be part of the outside main zone, _and_ the inside zone. It looked like the zone management code would handle that but I don't fully understand it.
I noticed that water was getting added before the interior was added, so that interior did not exist in the list of zone managers and the water wasn't added. I thought that if I changed the order then it would exist and get added to both but that' wasn't the case same problem.
make sense?
thanks for any pointers?
edit: I'm using a modified TGE 1.3, if that helps.
1. zoom in so your fov is small and look down at the water, turn gradually and when you are roughly axis aligned the water will dissapear.
2. water is outside a building, but the plane extends through and under the building. It crosses at one point from the outside zone to the inside zone where there is a pool of water. This was fine until we actually zoned off the inside zone, now When the portal that looks to the outside world isn't visible the inside water disappears.
I thought that problem (1) was just some sort of rendering problem where the field of view would be smaller than the blocksize and wouldn't render or something crazy like that. But in debugging, it looks like preprender image isn't even getting called for the water in both situations.
For problem 2 it seems that what I want to do is have the water be part of the outside main zone, _and_ the inside zone. It looked like the zone management code would handle that but I don't fully understand it.
I noticed that water was getting added before the interior was added, so that interior did not exist in the list of zone managers and the water wasn't added. I thought that if I changed the order then it would exist and get added to both but that' wasn't the case same problem.
make sense?
thanks for any pointers?
edit: I'm using a modified TGE 1.3, if that helps.
About the author
Recent Threads
#2
this now makes sure that the waterblock gets inserted on the client after all the interiors are registerd as zone managers. And the waterblock gets set up for the zones just like it does on the server,
but it didn't fix the problem so something else is at work here.
03/28/2006 (3:40 pm)
Tested adding this to beginning of WaterBlock::renderObject()static bool once = true;
if(once)
{
once = false;
this->mSceneManager->zoneRemove(this);
this->mSceneManager->zoneInsert(this);
}this now makes sure that the waterblock gets inserted on the client after all the interiors are registerd as zone managers. And the waterblock gets set up for the zones just like it does on the server,
but it didn't fix the problem so something else is at work here.
#3
in SceneTraversal.cc in buildSceneTree, after the client container fills the potential render list, just always add the waterblocks, so they get a chance to render if they think they should.
again, probably not the best thing to do if you have lots of waterblocks, but for us works fine.
04/12/2006 (2:53 pm)
So the solution I ended up going with for now isn't perfect but it works, and has taken care of all our dissapearing waterblock problemsin SceneTraversal.cc in buildSceneTree, after the client container fills the potential render list, just always add the waterblocks, so they get a chance to render if they think they should.
// Query against the container database, storing the objects in the
// potentially rendered list. Note: we can query against the client
// container without testing, since only the client will be calling this
// function. This is assured by the assert at the top...
gClientContainer.findObjects(prl.mBox, objectMask, prlInsertionCallback, &prl);
//clint: lets always insert our water! brute force for the one giant water plane
for (S32 i = 0; i < mWaterList.size(); i++)
{
if (mWaterList[i])
{
//todo could check for waterblock specific always render var
prl.insertObject(mWaterList[i]);
}
}again, probably not the best thing to do if you have lots of waterblocks, but for us works fine.
#4
It was a problem before when you added more waterblocks at different heights , the player behaved like he was in the water all the time.
Does this work now i haven't tried it out ?
04/13/2006 (3:57 am)
Hi Clint !It was a problem before when you added more waterblocks at different heights , the player behaved like he was in the water all the time.
Does this work now i haven't tried it out ?
#5
I don't know, I'm doing some work for EvilTwinStudios. And there's just one giant waterblock right now that was giving us problems. So I don't know if that problem is still there. When I was searching for a solution to this one though, I saw a couple threads where people seemed to have fixed it with some custom functions to check when you are in the waterblock. At least I thought I saw them :)
04/13/2006 (12:55 pm)
Hey Billy,I don't know, I'm doing some work for EvilTwinStudios. And there's just one giant waterblock right now that was giving us problems. So I don't know if that problem is still there. When I was searching for a solution to this one though, I saw a couple threads where people seemed to have fixed it with some custom functions to check when you are in the waterblock. At least I thought I saw them :)
Torque Owner Clint S. Brewer
but also interestingly: Although the waterblock gets created after the interiors are created on the server, on the client it is still created before the interiors are loaded, and thus doesn't get put into the zones for the interior in question.
hmm.
maybe I'll hardcode a rezone for the water and see if it makes any difference.