pit Posted December 20, 2010 Posted December 20, 2010 We have a big terrain (4 km x 8 km). Sometimes (it is very difficult to reproduce this bug), when we we try to throw camera from a corner of the terrain to it's center application crashes. When I managed to catch it under Visual Studio I found out the following. Terrain.cpp (lines 1759-1764, void TerrainCoarse::culling(TerrainCulling &c,const vec3 &camera,float visible_distance,const BoundFrustum &bf) ) childs[order[0]]->culling(c,camera,visible_distance,bf); childs[order[1]]->culling(c,camera,visible_distance,bf); if(childs[order[2]]) { childs[order[2]]->culling(c,camera,visible_distance,bf); childs[order[3]]->culling(c,camera,visible_distance,bf); } Terrain.cpp (lines 1805-1810, void TerrainCoarse::culling(TerrainCulling &c,const vec3 &camera,float visible_distance,const BoundFrustum &bf,const Occluder &o) ) childs[order[0]]->culling(c,camera,visible_distance,bf,o); childs[order[1]]->culling(c,camera,visible_distance,bf,o); if(childs[order[2]]) { childs[order[2]]->culling(c,camera,visible_distance,bf,o); childs[order[3]]->culling(c,camera,visible_distance,bf,o); } childs[order[0]], childs[order[1]] and childs[order[3]] can be null. I don't know what is the reason. My quick and dirty fix was to change code to something like: if (childs[order[0]]) childs[order[0]]->culling(c,camera,visible_distance,bf); if (childs[order[1]]) childs[order[1]]->culling(c,camera,visible_distance,bf); if (childs[order[2]]) childs[order[2]]->culling(c,camera,visible_distance,bf); if (childs[order[3]]) childs[order[3]]->culling(c,camera,visible_distance,bf);
serega Posted December 21, 2010 Posted December 21, 2010 Hello, pit! Could you please send us scene with your big terrain for test?
pit Posted December 21, 2010 Author Posted December 21, 2010 Could you please send us scene with your big terrain for test? Hello, Sergey! I fear that it is realy too big: approximately 900 Mb on hard disk (only terrain).
Recommended Posts