Error, neg fog coord
by Jaimi McEntire · in Torque Game Engine · 05/22/2005 (7:22 pm) · 5 replies
I'm having trouble with one of my test missions. I'm getting this error in debug builds: "Error, neg fog coord!". This appears to be an assert in interior.cc. The thing is, the interiors I'm using are from the starter.fps demo (the orc village), so I don't think it's an interior problem.
The main thing that is different in this mission is that I imported a height map, and everything is lower than the old starter mission (still above zero, though), including the water block. Thinking I must hav messed up something in the sky, I completely replaced the sky datablock with the default one. This didn't make any difference, though.
Does anyone have any ideas what could cause this?
The main thing that is different in this mission is that I imported a height map, and everything is lower than the old starter mission (still above zero, though), including the water block. Thinking I must hav messed up something in the sky, I completely replaced the sky datablock with the default one. This didn't make any difference, though.
Does anyone have any ideas what could cause this?
#2
mPoints[index].fogCoord = state->getHazeAndFog(mFabs(distPlane.distToPlane(mPoints[index].point)) + distOffset,
(mDot(mPoints[index].point, osZVec) + worldZ) - worldP.z);
AssertFatal(mPoints[index].fogCoord >= 0.0f, "Error, neg fog coord!");
it appears to be some problem in either the setup of the fogbands in SceneState::setupFog, or in SceneState::getHazeAndFog. A cursory inpsection shows that there are two seperate arrays for positive and negative versions of the bands, And one array is selected based on the input deltaz. However, the second band is resulting in large negative numbers popping out.
I'll continue to debug, in the meantime, if anyone has seen this before, I'd be happy to hear how it was fixed.
05/22/2005 (8:36 pm)
Yes, its Interior::setupActivePolyList, in this block of code:mPoints[index].fogCoord = state->getHazeAndFog(mFabs(distPlane.distToPlane(mPoints[index].point)) + distOffset,
(mDot(mPoints[index].point, osZVec) + worldZ) - worldP.z);
AssertFatal(mPoints[index].fogCoord >= 0.0f, "Error, neg fog coord!");
it appears to be some problem in either the setup of the fogbands in SceneState::setupFog, or in SceneState::getHazeAndFog. A cursory inpsection shows that there are two seperate arrays for positive and negative versions of the bands, And one array is selected based on the input deltaz. However, the second band is resulting in large negative numbers popping out.
I'll continue to debug, in the meantime, if anyone has seen this before, I'd be happy to hear how it was fixed.
#3
05/23/2005 (2:22 am)
Wild... No, I haven't seen it before, but I'm interested in hearing how the debugging process goes!
#4
05/24/2005 (9:04 pm)
Ok - I'll post the resolution in case anyone else sees this alert. The problem was that the fogvolumes (on the sky object) had invalid data in them. Even though I never manually edited them, somehow during my terrain import and edit, they got "messed up". Manually editing them and resaving the mission solved the problem.
#5
Restarted - and coudn't repeat it .. so, really strange error.
10/18/2006 (3:01 pm)
Strange, but I got exactly same error only once, while debugging my new AI.. was running in the world, that we use already for a few month...Restarted - and coudn't repeat it .. so, really strange error.
Associate Kyle Carter