Re: [Flightgear-devel] Upcoming Random Buildings changes

2013-10-11 Thread Stuart Buchanan
On Wed, Sep 18, 2013 at 4:16 PM, Stuart Buchanan wrote:
 This is to give a heads up on some changes that I'm planning for
 Random Buildings for the V3.0 release, and to allow for
 comments/suggestions/ideas.

I've now got the new system broadly working on a private build:

http://www.nanjika.co.uk/flightgear/buildings.jpg

I've managed to minimize apparent tiling by randomly choosing between
building sizes and random objects at each point (subject to dimension
restrictions).

I need to sort out the random objects which need to be rotated by 90
degrees (see the bottom left where an orange school building goes
across the road).

As expected, the downside is that creating the object masks takes
quite a bit longer.  It's taken me about 4 hours to generate the mask
used here for the city1.png texture.  Generating the buildings at
runtime is also a bit slower so I expect to implement the PagedLoD
next.

-Stuart









 In 2.12.0 the algorithm for the placement of random buildings is a
 rather scattergun approach.  materials.xml sets a building density
 (amongst other building attributes) which is used to generate a number
 of random points on each triangle that makes up the scenery.

 These random points are checked against a mask to ensure they aren't
 being placed in the middle of roads, and then rotated to the correct
 orientation to match the texture (using the red channel of the mask).

 This broadly works, but the placement is fairly unrealistic:
 - The mask is quite broad, and some buildings quite large, so they can
 still stick out into the roads, and generally don't line right up
 against the street.
 - The spacing of buildings has to be quite conservative.

 So, in V3.0 I plan to change this. Instead of using a scatter-gun
 approach to placement and a mask, random building location will be
 read directly from the mask, defined by a single pixel.  The color
 (actually blue value from 0-255) will define the size of building
 (small medium, large), and the red channel the rotation.

 So instead of a material designer blocking out a large area for random
 buildings to be placed within, they will define the specific location
 for each random building.

 Creating masks is going to require quite a bit more work in the new
 world, but the end result should be better.

 There is an open question of how to handle random object placement,
 which also use the blue channel of the object mask:

 -  For areas that don't use random buildings, I'm tempted just to
 leave it as-is for the moment, as it reduces the number of object
 masks that need to be re-created.

 - For areas with both random buildings and random objects I'm planning
 to make groups of objects to specific blue values.  So, a blue value
 of 234 might equate to placing a silo or a farmhouse, while a blue
 value of 233 might place a church, or tower block.  The mapping will
 be defined in the materials.xml file.

 Command, questions and offers of help to update some object masks are
 all welcome :)

 -Stuart

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Upcoming Random Buildings changes

2013-10-11 Thread geneb
On Fri, 11 Oct 2013, Stuart Buchanan wrote:

 On Wed, Sep 18, 2013 at 4:16 PM, Stuart Buchanan wrote:
 This is to give a heads up on some changes that I'm planning for
 Random Buildings for the V3.0 release, and to allow for
 comments/suggestions/ideas.

 I've now got the new system broadly working on a private build:

 http://www.nanjika.co.uk/flightgear/buildings.jpg

That looks realy nice Stuart!  Good job!

Is it possble to place buildings manually and have the random buildings 
fill around them without interference?

g.

-- 
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby.  Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Upcoming Random Buildings changes

2013-10-11 Thread Stuart Buchanan
Hi Tim,

On Fri, Oct 11, 2013 at 12:55 PM, Tim Moore wrote:
 Cool stuff. Are those all individual models, or instanced geometry, or what?
 :)

The vast majority are instanced geometries, though there are some random
models interspersed.

As mentioned previously, I'd like to move back to the previous implementation
from (IIRC 2.8.0) where the buildings were collected into massive objects as
it provides collision detection and more variety.

On Fri, Oct 11, 2013 at 1:54 PM, geneb wrote:
 Is it possble to place buildings manually and have the random buildings
 fill around them without interference?

Not yet, but that's a known bug that I would dearly like to fix. I'm hoping that
the refactoring required to implement the PagedLOD will provide access
to the data required.  At present the static objects (e.g. manually placed
buildings) are only ingested after the geometry and random objects have
already been generated.

With the PagedLOD approach the random objects will be generated only
when the aircraft gets into range, so I'm hoping I can simply check against
the bounding box of each static object.

-Stuart

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel