overhead cameras draw stuff in wrong order - RESOLVED
by Chris · in Torque 3D Professional · 08/27/2010 (10:41 pm) · 7 replies
This has been a bug for a while now, far as I've used T3D.
We use a overhead camera to draw some areas of our mission, this works great except it seems to draw stuff under the ground first such as water blocks, rivers, underground caves, etc draw OVER the landscape instead of under it.
Here is part of the code that is doing the drawing, I don't think we are doing anything wrong here.
e: It does not seem that ortho has anything to do with this.
e2: Also when I detach the camera from the player and move the camera up a bit this call works perfect, it seems that somehow the players camera effects this instead of just the cameraQuery stuff
We use a overhead camera to draw some areas of our mission, this works great except it seems to draw stuff under the ground first such as water blocks, rivers, underground caves, etc draw OVER the landscape instead of under it.
Here is part of the code that is doing the drawing, I don't think we are doing anything wrong here.
e: It does not seem that ortho has anything to do with this.
e2: Also when I detach the camera from the player and move the camera up a bit this call works perfect, it seems that somehow the players camera effects this instead of just the cameraQuery stuff
bool GuiMapCtrl::processCameraQuery(CameraQuery *q)
{
// Scale ranges based on the highest/lowest point in the terrain
q->object = NULL;
q->nearPlane = 150;
q->farPlane = 240;
q->ortho = true;
q->fov = 90;
// Make us high up, facing straight down.
q->cameraMatrix = MatrixF(EulerF(3.14/2, 0, 0)); // rotate us to look straight down
q->cameraMatrix.setPosition(Point3F(Location.x,Location.y, Location.z + 200)); // and high enough we won't clip
return true;
}GFX->pushActiveRenderTarget(); GFX->pushWorldMatrix(); GFX->setActiveRenderTarget(mRenderTarget); GFX->clear(GFXClearStencil | GFXClearZBuffer | GFXClearTarget, ColorI(1, 0, 0), 1.0f, 0); gClientSceneGraph->setVisibleDistance(280); FrameAllocator::setWaterMark(0); gClientSceneGraph->renderScene(ScenePassType::SPT_Diffuse, EnvironmentObjectType | TerrainObjectType | InteriorObjectType | WaterObjectType | StaticObjectType ); FrameAllocator::setWaterMark(0); GFX->popActiveRenderTarget(); GFX->popWorldMatrix();
About the author
#2
08/30/2010 (11:08 pm)
This is still a big issue for us, I am available for debugging and suggestions
#3
Chris, is this still an issue with Beta 3? If so, could you please pass along your GuiMapCtrl that I may test with? If you want to mail it, send it to davew@garagegames.com.
Thanks!
- Dave
02/07/2011 (11:52 pm)
Greetings!Chris, is this still an issue with Beta 3? If so, could you please pass along your GuiMapCtrl that I may test with? If you want to mail it, send it to davew@garagegames.com.
Thanks!
- Dave
#5
04/24/2011 (8:07 pm)
Since we've been unable to reproduce this and there's been no response from the OP on it I'm marking this as resolved.
#6
04/24/2011 (11:57 pm)
This bug does still exist in beta 3, it looks like the offending code is posted above
#7
04/25/2011 (1:49 am)
If you can reproduce it using a clean 1.1 Preview then I'll reopen it, but otherwise it appears to not be occurring anymore.
Full Sail QA&U Lab Intern