Terrain rendered inside portal is distorted (video)
by Kenneth Eves · in Torque Game Engine Advanced · 02/13/2010 (5:34 am) · 3 replies
When looking through an interior portal at terrain, the terrain is distorted as if the 'camera' location or fov is confused.
Any suggestions on where to look in TGEA for this? (version 1.7.1)
Oh, this is classic terrain, 4 block size (tried 8 same results), tiled on/off is the same.
Watching this and seeing the terrain move away quickly (even painted a spot on the ground at the doorway) I'm thinking the camera location inside the interior (that's local space, right?) is being misreported when the terrain renders.
www.youtube.com/watch?v=Pm3BTtKnJuk
edit: I think I've narrowed the result of the bug to terrdata.cpp
fn: void TerrainBlock::renderObject(SceneState* state, RenderInst *ri)
code:
// Store object and camera transform data
sgData.objTrans = getRenderTransform();
sgData.camPos = state->getCameraPosition();
This is stashing the world loc of terrain and world loc of camera (actually frustum). Still not sure where being inside of a portalled space affects this. I'm guessing it's like xyz (coords of the interior) + xyz (coords of the camera relative to the interior). Now to try and find it.
edit: Noticed one thing. When moving the defect is less frequent, when stopped it is constant. Something caching a broken frustum?
edit: Found this from 1.8.2
# Frustum::getProjectionMatrix() now gives a correct projection matrix
Files Changed:
engine/source/math/frustum.cpp
... ported the change in, didn't work :-(
Ken
Any suggestions on where to look in TGEA for this? (version 1.7.1)
Oh, this is classic terrain, 4 block size (tried 8 same results), tiled on/off is the same.
Watching this and seeing the terrain move away quickly (even painted a spot on the ground at the doorway) I'm thinking the camera location inside the interior (that's local space, right?) is being misreported when the terrain renders.
www.youtube.com/watch?v=Pm3BTtKnJuk
edit: I think I've narrowed the result of the bug to terrdata.cpp
fn: void TerrainBlock::renderObject(SceneState* state, RenderInst *ri)
code:
// Store object and camera transform data
sgData.objTrans = getRenderTransform();
sgData.camPos = state->getCameraPosition();
This is stashing the world loc of terrain and world loc of camera (actually frustum). Still not sure where being inside of a portalled space affects this. I'm guessing it's like xyz (coords of the interior) + xyz (coords of the camera relative to the interior). Now to try and find it.
edit: Noticed one thing. When moving the defect is less frequent, when stopped it is constant. Something caching a broken frustum?
edit: Found this from 1.8.2
# Frustum::getProjectionMatrix() now gives a correct projection matrix
Files Changed:
engine/source/math/frustum.cpp
... ported the change in, didn't work :-(
Ken
About the author
<3 TGE/A Quickly becoming a fan of T3D 1.2
#3
New video showing wire frame, zone mode. Easy to see the issue on this one.
www.youtube.com/watch?v=geFMTGBEWfM
I've gotten personal responses saying they've seen this in TGEA demos too. Never been identified or fixed?
Ken
02/13/2010 (10:50 pm)
Work-around doesn't work. It's better than classic in some building locations, but fails on others.New video showing wire frame, zone mode. Easy to see the issue on this one.
www.youtube.com/watch?v=geFMTGBEWfM
I've gotten personal responses saying they've seen this in TGEA demos too. Never been identified or fixed?
Ken
Torque 3D Owner Kenneth Eves
XAP GAMES