Hi,
Sorry to keep 'pushing' this, but just hope
someone else will have a 'clue'...
I managed to trap the 'problem' while under
MSVC debug, thus have 'discovered' some other
things, which seem quite important...
As you may know, because Atlas is marked as
a CONSOLE application, the first 'window' created
is a CONSOLE window. Then the glut window like
windows are created.
So I got to this 'slow-down' by bringing up the
console window over the top of the main window,
just to see the output...
And when the console window covers part of the Atlas
main, and I click on any exposed part of main,
which should send the console to the background...
Well it does, but I get this dreaded SLOW DOWN!
And this seems a 'repeatable' way to get this
problem ;=((
Then when I clicked 'break all' in the debugger,
and get a random 'break' to debugger, I found it
was drawing thousands of airports and
runways, in AirportsOverlays.cxx, repeatedly...
For example, the line, in drawForeground() -
const vector<Cullable *& interections =
_frustrm->intersections();
yielded 0x55F4 (22,004) vectors. That does NOT
seem normal!!!
As you can imagine, that means zillions of lines
of maths for one thing... aside from drawing
a/p - r/w simply NOT in view...
And all this is during a WM_PAINT call!!!
So why does _frustrum->intersections() get so,
_SO_ large???
I added some debug output, and see that normally
when I run Atlas with --airport=YGIL --zoom=62
'intersections' is just ONE(1), as it should be...
The only airport at that zoom level is YGIL.
Then when I zoom out to say 620, the 'intersections'
rises to 27. And at zoom 6200, to 802. EVEN at
zoom=24682. where I can see the whole globe,
I still only get 2621 'intersections' ;=()
So _WHY_, in some particular circumstance I am yet to
fully understand, does the 'culling' part fail,
and I get a list of (I guess!) ALL a/p loaded, over
22 THOUSAND!!!
But it seems definitely the reason for the SLOW
DOWN ;=))
And as stated previously, it does seem something
to do with a change in window focus... When I
click-nd-drag on an exposed part of Atlas main
when covered by another window...
I also turned on the DEBUG_OUTPUT in Culler.cxx,
to see if this showed me anything... but not sure
what all the number show. I can see the first hex
value is the 'this' of the 'user', but the other
numbers... checks, grabs, bounds, extensions, and
largest...
Also I have added lots of debug stuff all over
the place, and uploaded a log file output
of a some sessions, one where I induced this slow
down...
First is a clean run - no problems -
http://geoffair.org/tmp/Atlas01.txt
Next is where main lost focus to another window,
and I clicked on an exposed part of Atlas main.
http://geoffair.org/tmp/Atlas02.txt
It shows after the problem happens, it spent
MANY MINUTES in the redraw, when the overlay
intersections.size() rose to 22004!
But then, when the window went black, after
the 2 very long (many minutes!) enter-exits, the
enter-exits sped up again, but still about 2
seconds each, and nothing displayed...
Looking harder, I can see a mouse down event
calls -
if (scenery->intersection(x, y, &oldC)) {
dragging = true;
// added debug output here, to show oldC
} else {
dragging = false;
}
...
Then in mouseMotion()
if (dragging) {
SGVec3<double> newC;
if (scenery->intersection(x, y, &newC)) {
sgdVec3 axis;
sgdMat4 rot;
sgdVectorProductVec3(axis, newC.data(), oldC.data());
... etc ...
}
But I will admit I do not understand all that is
happening, and why does this event then cause the
AirportOverlay intersections to go OFF scale???
And as the log shows, it is NOT only the ap-overlays,
but the scenery, navaids, etc, all go to what look
like _MAX_ counts!
And more specifically, why this problem ONLY when
there is another window at the top of the z order?
Of course normally there is no problem clicking and
dragging the map around when the main_window is
at the top of the z order of things...
I do also note the scenery 'this' the checks: goes from
about 250 to 575, and ap-overlay goes from 328 to
5982, but as stated not too sure what these numbers
show, but they have also substantially 'increased'
after this mouse event...
AH HA! If, when I have the 'black' screen, after
waiting 10-12 minutes plus, and I use 'j' key
to bring up the edit widget, and enter say
YGIL<enter>, everything returns to normal!
The correct scene is displayed, and I can click and
drag again ;=)) And the checks: numbers, and
intersections values return to 'normal'... so
it is a temporary _VERY_ _BAD_ state...
And of course, it goes without saying that I see
_NONE_ of this craziness in Ubuntu Atlas ;=))
So Brian, or others, maybe this explanation,
with new information, will provide SOME clues
of where or what to look at?
Or where to add more debug information...
like what factors influence the _frustrum.
Culler() interface... Why would it suddenly
select _ALL_?
Hopefully, now with a very repeatable WIN32
scenario... but HELP needed ;=((
Regards,
Geoff.
Links:
http://geoffair.org/tmp/Atlas02.txt - bad
http://geoffair.org/tmp/Atlas01.txt - good
PS: This is holding me back from updating my Atlas
WIN32 web page, now I have discovered how to
easily repeat it... and even if/when FIXED, will
take AGES to unwind all this DEBUG stuff
again ;=(( but if it leads to a solution, will
add MORE...
|