Random Buildings: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
As of 05/2012, FlightGear has improved support for randomly placed buildings. This feature is available in the 2.8.0 release.
Please note that this wiki article may be outdated, the latest information on random buildings can be found in: [http://gitorious.org/fg/fgdata/blobs/master/Docs/README.materials $FG_ROOT/Docs/README.materials ].
[[File:Random-buildings.jpg|thumb|Random Buildings]]
[[File:Random-buildings.jpg|thumb|Random Buildings]]


In an effort to improve the scenery in cities, towns and villages with minimal impact to framerate, Stuart has been working on automatically generated "random buildings". The idea is to have FG itself generate buildings with randomized size, shape and texture in a very efficient manner, and builds on the work that he and Tim Moore did on random vegetation a couple of years ago. This is now available in git.
As of 05/2012, FlightGear support "random buildings", which are generated at runtime and placed in Urban and Town areas.  In v2.8.0 these take up a lot of memory, but in subsequent releases this has been improved significantly.


Building generation is configurable through materials.xml, and documented in Docs/README.materials. It is designed to be flexible enough that we can have different types of cities in Europe compared with the USA, or Africa. The current texture used for the buildings is a proof of concept, and rather limited by Stuart's artistic abilities. If anyone is interested in creating a better texture, please get in touch with Stuart on the mailing list or forums.  
Building generation is configurable through materials.xml, and documented in [http://gitorious.org/fg/fgdata/blobs/master/Docs/README.materials $FG_ROOT/Docs/README.materials ]. It is designed to be flexible enough that we can have different types of cities in Europe compared with the USA, or Africa. The current texture used for the buildings is a proof of concept, and rather limited by Stuart's artistic abilities. If anyone is interested in creating a better texture, please get in touch with Stuart on the mailing list or forums.  


At a functional level, there are three different size of buildings
At a functional level, there are three different size of buildings
Line 18: Line 13:
sizes of each building. The actual buildings are then generated by
sizes of each building. The actual buildings are then generated by
FG itself directly as OSG primitives.
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:
For those interested, the technical background is as follows:
Line 34: Line 19:
- a single 1024x1024 texture is used for all the buildings, minimizing
- a single 1024x1024 texture is used for all the buildings, minimizing
the number of state changes on the GPU
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.


= Related =
= Related =

Revision as of 20:48, 21 September 2012

Random Buildings

As of 05/2012, FlightGear support "random buildings", which are generated at runtime and placed in Urban and Town areas. In v2.8.0 these take up a lot of memory, but in subsequent releases this has been improved significantly.

Building generation is configurable through materials.xml, and documented in $FG_ROOT/Docs/README.materials . It is designed to be flexible enough that we can have different types of cities in Europe compared with the USA, or Africa. The current texture used for the buildings is a proof of concept, and rather limited by Stuart's artistic abilities. If anyone is interested in creating a better texture, please get in touch with Stuart on the mailing list or forums.

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.

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

Related