I've just checked in a major revision to my new randomly-placed object
code: it cuts down the memory usage a fair bit and eliminates long
pauses when complex tiles fall out of the cache.  There are still some
stutters at very high speeds (i.e. 3000kt), but at normal speeds, all
seems smooth now.

The basic principle is that I add only a placeholder to the scene
graph for the objects in each triangle.  When it falls into range, a
callback creates the objects, and when it falls out of range, another
callback frees them again.  That way, we have objects added only to
triangles that are close to the plane, and there is no need to free
hundreds or thousands of objects at once when a tile falls off the
cache.

I also modified the material code so that an object and its texture
are loaded only once, no matter how many materials use it.

According to some quick tests, with randomly-placed objects disabled,
FlightGear uses 214MB of which 79MB are RSS; with randomly-placed
objects enabled, FlightGear uses about 237MB of which 102MB are RSS.
That's a bit of a blow-up, but not nearly as bad as it was, and after
a while the memory usage stops increasing and sometimes actually falls
a bit.

Please everyone give this a brutal workout to find any further
problems.  To enable randomly-placed objects, use

  fgfs --prop:/sim/rendering/dynamic-objects=true


All the best,


David

-- 
David Megginson, [EMAIL PROTECTED], http://www.megginson.com/

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to