Hi Tim, Curt, et al,

I've prepared a patch and did a number of test flights tonight - and
had no more scenery issues. I'll still do a bit more testing, but
maybe someone else seeing these problems regularly could already
check, if this fixed their problems, too. The patch is attached to the
bug issue (matching latest GIT):
http://code.google.com/p/flightgear-bugs/issues/detail?id=122

> The cull callback is called from OSG's culling traversal. If OSG determines
> that an object's bounding sphere intersects the viewing frustum, it calls
> the cull callback -- if there is one -- to traverse that object and perform
> finer grain culling. If there is no cull callback, OSG does the traversal
> itself. Anyway, it's a good way to perform an action when an object is in
> view.
> The timestamp used by the cull callback comes right from OSG's "frame
> stamp" and should be consistent with the tile code. there could be a logic
> error in the tile cache.
> It is possible for the tile cache code, which runs in the update traversal,
> and the cull callback to run in different threads. However, they should
> never run at the same time: the cull traversal starts when the the update
> traversal has finished, and the next update traversal blocks on the cull and
> draw traversals. Now, the code that actually loads the tiles -- the database
> pager -- does run asynchronously. I'll need to check if any of the tile
> cache code runs in the database pager thread, but don't think any does.

I've checked the timestamp issue again. It was not a threading
problem. The current time of the tile cache was simply updated *after*
scheduling the next tiles. So, cache's time was one frame behind -
which could cause problems. This is easily changed. But in fact, the
cache's time has to be even greater than the timestamps of all tiles
in the cache, otherwise it's not guaranteed that newly scheduled tiles
can be loaded. I therefore also changed the timestamp update for
existing tiles to prevent this from happening. My patch does this
without using the osg callbacks now, I'm not sure if we really still
need these. The problem with the osg callbacks is, that these already
updated tiles with the latest frame time - so the cache's time
couldn't be really newer. But I guess someone (Tim?) with a better
insight to the cache modules should have a closer look...

Ok, I hope this patch is usable (or at least useful :-) ) to finally
fix this issue.

cheers,
Thorsten

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to