Hi All,

A while back I initiated a discussion about improving our random
buildings, and got lots of very useful feedback and suggestions.  The
first part of this (masking of random object and vegetation placement
to match the underlying terrain texture) has been in git for some

I have finally got around to implementing the second part - generating
(efficient) random buildings.

Before and after screenshots:
Before - http://www.nanjika.co.uk/flightgear/buildings-old.jpg
After - http://www.nanjika.co.uk/flightgear/buildings.jpg

At a functional level, there are three different size of buildings
(small, medium, large), with slightly different constraints (small and
medium buildings are never deeper than they are wide, small buildings
may have pitched roofs).  Various parameters can be set in the
materials.xml file, such as the proportion of each building size, the
texture file (which is shared across all buildings),  and the range of
sizes of each building.   The actual buildings are then generated by
FG itself directly as OSG primitives.

Obviously, this would be pointless if frame-rates were hit to the same
extent as they are with a similar number of normal models.  The good
news is that on my system there is _no_ fps drop from the random
buildings.  I get the same frame-rate whether or not the random
buildings are generated or not.  The same applies whether or not I'm
running with Rembrandt.

Of particular note - I get significantly better frame-rates with this
rather than the urban shader.

For those interested, the technical background is as follows:
- a Quadtree is used to ensure very fast culling of the buildings -
based on the work that Tim Moore did for the forests.
- a single 1024x1024 texture is used for all the buildings, minimizing
the number of state changes on the GPU
- all the buildings at the leaf of the quadtree are part of the same
geometry, so the GPU can churn through it very quickly without having
to change state.

There are still some bugs to be worked out before this can be pushed
to git,  but I'm hoping to get it checked in over the weekend.

If someone is interested in spending some time creating a better
default texture, please get in touch.


Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
Flightgear-devel mailing list

Reply via email to