On Jan 27, 2008 1:21 PM, Norman Vine wrote:
> < note I haven't dug into the code either >
>
> The standard way of doing this is to time limit the loader
> Thread. Eg loading trees only a few per frame as time allows.
> perhaps into a temporary data object.
>
> The OSG LOD loader thread is an example of how to do this
In this case the trees aren't so much loaded ... there's only one small
texture that defines the trees (or group of randomized tree images.) What
does need to be done is that a set of random locations needs to be generated
across the surface of each tile ... and this needs to happen sometime after
the terrain is loaded.
Right now this appears to be done in the main render thread once the
polygons get within some visible distance (although the behavior of this is
slightly weird and you can be ontop of an area before the trees are actually
generated.)
Instead, I was suggesting that it might be better and maybe even simpler to
create this list of random tree locations in the tile loader after the base
geometry is loaded, but before the tile is connected into the scene graph.
But certainly limiting the number of cpu cycles the tile loader thread
consumes per frame would be a good thing, as long as it can keep up with
your rate of motion.
One of the reasons (I think) that OSG start up times are so long is that the
loading is getting interleaved with the FDM and everything else, but we
aren't actually showing the view until the loader has loaded enough data.
So there is much wasted effort at the beginning until enough terrain is
loaded and the splash screen is removed and the terrain actually drawn.
This code has grown really complex over the years, but at some point, now
that we are using OSG, it might be worth revisiting some of these earlier
design choices. They made sense for a plib world, but perhaps not for an
OSG world with better threading support.
Regards,
Curt.
--
Curtis Olson: http://baron.flightgear.org/~curt/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel