Currently I'm testing a new scheme for caching tiles. See the changes listed below for details on how it is different. The goal is to stabilize the new viewer code's interaction with the flightgear scenery code.
As many have observed there are numerous problems that have come up since incorporating the configurable views, including significantly the tower views. The previous viewer code updated scenery parameters based on the position of view that was always tied directly to the position of the FDM (longitude/latitude/altitude). The problems arose because the new viewer is specifies alternate postions, for example the tower occupies a static (non-moving) position. The problems corrected with the change include: 1) Switching to tower view shows the proper tiles (rather than a plain blue screen) even if the aircraft has flown hundreds of miles away. 2) The skydome, clouds, etc now render correctly. 3) In CVS Ground lights sometimes jump momentarily when flying over a new tile. 4) The FDM maintains correct altitude (doesn't get screwed up by FlightGear code) even if the view is on the tower view. Note that this is achieved in current CVS by fudging the "view position" to the "aircraft position" for tower views (thus contributing to the cause of problem #1). The changes I'm making include the following: 1) Tile Entries are purged from cache based on age in milliseconds, rather than distance from a view position as previously done. This is necessary because the tower position(s) and aircraft position(s) are multiple rather than a single position that can be considered the "center" of cached tiles. Tiles are timestamped when created and when accessed (but not every time rendered of course). 2) If the FDM position and View position differ (as in Tower view) the tile manager is updated twice per frame. Generally this update is fairly lightweight and doesn't affect performance noticably. Note that when in tower view, the longitude/latitude/altitude of the view doesn't change, so this keeps the load light. 3) Removed fudged behavior in the viewer and fixed a couple bugs found in the viewer class. 4) A triggered event causes the view to refresh (update the timestamps) on its tiles once every 15 seconds. Again this is a pretty lightweight, updating this frequently prevents tile reloading from getting triggered. 5) Tile cache size is doubled over what it was in order to maintain smoothness in making frequent view switches. This will need to be re-evaluated and optimized when we go to multiple instances of FDM (so that we don't need to increase another 50% for a second FDM for example). On my system I'm seeing a 10-15% increase in memory footprint. So far (on my system 750mhz (100 Bus) and voodoo3) the frame rate seems to be about the same as it was before these changes. I'll need to do more testing to be sure and we'll have to get some feedback from others. In any case the changes seem to be necessary to ensure the integrity of the multiple views. This is requiring a lot of testing, both with threads and not, so it'll be another day or two before I'll be submitting patches. If anyone sees problems with this approach for what they are doing, let me know. Best, Jim _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
