Board index FlightGear Development Scenery

osm2city.py development

Questions and discussion about enhancing and populating the FlightGear world.

Re: osm2city.py development

Postby psadro_gm » Fri Jun 06, 2014 1:31 pm

As for intersections: whenever a line segment crosses another line segment at the same zorder. Right now we take the first polygon, then clip the second so they don't z-fight - it ends up looking that the first line is on top of the second. The new intersection code generates new polygons at the intersection that meet at a point, as such the texture coordinates 'line up' in v to form an intersection. Right now - I'm doing it so the yellow taxiway lines with a black border always have yellow in the middle, and black borders on the sides, and looks correct. Highway intersections would be similar, but the intersection point would need to vary with the intersection type - so for instance, highway on ramps don't intersect the highway in the middle lane - they need to intersect at the outermost lane, etc.

In the future, yes - I plan to have just landclass scenery as the terrain base, and the roads, streams, and rail draped on top. This will be part of the LOD scheme - only a few tiles will load the roads. I haven't decided how many .BTGs - perhaps keep motoryways seperate - as you can see motorways quite a ways into the distance... It will slightly decrease the landclass triangle count, but I still plan on flattening the terrain where roads go. These 'flattening' polygons will be wider and longer than the OSM feature data, so it will probably reduce the terrain complexity a bit. These polys will also contain a flag so that the autogen handler would not place trees / building on these triangles. An autogen exclusion mask, so to speak.
8.50 airport parser, textured roads and streams...
psadro_gm
 
Posts: 751
Joined: Thu Aug 25, 2011 2:23 am
Location: Atlanta, GA USA
IRC name: psadro_*
Version: git
OS: Fedora 21

Re: osm2city.py development

Postby Gijs » Fri Jun 06, 2014 1:55 pm

psadro_gm wrote in Fri Jun 06, 2014 1:31 pm:In the future, yes - I plan to have just landclass scenery as the terrain base, and the roads, streams, and rail draped on top.

I did some early experiments in FlightGear+osgEarth and that seems to be rather do-able. You can load shapefiles and process them as you like. All the building blocks are already there. The example below only contains drapped roads with a fixed width per road type, but you can even read additional data from the shapefiles (number of lanes, width etc.).

Image
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9401
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: osm2city.py development

Postby psadro_gm » Fri Jun 06, 2014 2:12 pm

The OSGEarth draping is a good example - it breaks up polygons by intersecting them with the underlying triangle mesh. What I am unsure about is how they handle overlapping polygons - I assume they are clipped - as I can see the results look the same as current terragear roads. I had played around with the idea of run time draping, but there are a couple of issues.

1) mesh deformation - think of mountain roads - we really want to flatten out a ledge for the road. lakes should be smoothed so we can land seaplanes, etc.
2) underlying landclass - it's difficult to mask the forest landclass to keep trees from growing out of the road if we don't always have the road generated during scenery generation.

So I'm still going to implement the draped roads at scenery generation time - but at run time, we can choose to load them or not.

One thing OSGEarth has that the traditional terragear scenery does not do very well (other than the ortho-imagery) - is the LOD handling. Even the upcoming scheme won't be as advanced, - but OSGEarth is using a regular grid, so it's much easier for them.
8.50 airport parser, textured roads and streams...
psadro_gm
 
Posts: 751
Joined: Thu Aug 25, 2011 2:23 am
Location: Atlanta, GA USA
IRC name: psadro_*
Version: git
OS: Fedora 21

Re: osm2city.py development

Postby Johan G » Fri Jun 06, 2014 2:51 pm

psadro_gm wrote in Fri Jun 06, 2014 1:31 pm:I plan to have just landclass scenery as the terrain base, and the roads, streams, and rail draped on top.

Would they have a berm that would allow one to enter the road if one has driven off from it, as well as to hide the separation from the terrain when the road traverses slopes?
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5613
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: osm2city.py development

Postby psadro_gm » Fri Jun 06, 2014 6:33 pm

the draped polygons will be coplanar with the underlying terrain - I don't really mean - 'on top' - I mean coplanar with either polygon-offsetting ( for the non-shader solution ), or translating the poly within a shader (i4dnf would have to explain how this is done - he has a working demo with the airport lines, now.) Ideally, there would be no visual difference between cut in roads and draped roads.
8.50 airport parser, textured roads and streams...
psadro_gm
 
Posts: 751
Joined: Thu Aug 25, 2011 2:23 am
Location: Atlanta, GA USA
IRC name: psadro_*
Version: git
OS: Fedora 21

Re: osm2city.py development

Postby radi » Sun Jun 08, 2014 10:16 am

Thanks psadro_gm for explaining! Your concept really makes sense to me, so I won't put too much energy into my humble python clipping algorithm.
OSM buildings for LOWI, EDDC
Custom scenery for VHXX YMML
Edit .stg via the FG Object Placement Tool
radi
 
Posts: 643
Joined: Mon Aug 25, 2008 4:24 pm
Location: YMML, EDDC

Re: osm2city.py development

Postby radi » Sun Jun 08, 2014 10:19 am

Image
Roads and buildings now fit together correctly. And the algorithm knows the road intersections -- next step is to texture these.
OSM buildings for LOWI, EDDC
Custom scenery for VHXX YMML
Edit .stg via the FG Object Placement Tool
radi
 
Posts: 643
Joined: Mon Aug 25, 2008 4:24 pm
Location: YMML, EDDC

Re: osm2city.py development

Postby radi » Mon Jun 09, 2014 2:19 pm

Image
Image
Image

Lightmaps are back, and roads now also get lit. First try, still have to fiddle with colors.

Thorsten, can I make a wish for a shader you suggested a while ago: red and white dots moving in opposite directions, please?
OSM buildings for LOWI, EDDC
Custom scenery for VHXX YMML
Edit .stg via the FG Object Placement Tool
radi
 
Posts: 643
Joined: Mon Aug 25, 2008 4:24 pm
Location: YMML, EDDC

Re: osm2city.py development

Postby Thorsten » Mon Jun 09, 2014 3:10 pm

Hm... do you have the scenery tile for download somewhere? I need a test case obviously... or is this Innsbruck as it comes?
Thorsten
 
Posts: 11441
Joined: Mon Nov 02, 2009 8:33 am

Re: osm2city.py development

Postby Hooray » Mon Jun 09, 2014 3:22 pm

wow, looking forward to seeing traffic simulated !
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: osm2city.py development

Postby hvengel » Mon Jun 09, 2014 11:13 pm

Yes this whole thing is an amazing bit of work that has tons of potential. This combined with OSG Earth could elevate FightGear scenery to level that is approaching commercial simulators. One of the more significant FlightGear issues for me currently is that my home area is virtually completely unpopulated in FlightGear and the current scenery has the OSG roads with huge areas where there are roads going all over the place but not a single building. This is probably a land class issue in the current scenery generation system (IE. the land class data is not correct). I hope this evolves into something that fixes that issue. Please keep pushing this forward.
hvengel
Retired
 
Posts: 1128
Joined: Sun Dec 24, 2006 4:35 am
Location: Minden Nevada

Re: osm2city.py development

Postby Hooray » Tue Jun 10, 2014 11:01 am

hvengel wrote in Mon Jun 09, 2014 11:13 pm:Yes this whole thing is an amazing bit of work that has tons of potential. This combined with OSG Earth could elevate FightGear scenery to level that is approaching commercial simulators.


As usual, our main problem here is lack integration, i.e. our default scenery engine supports many features that are not really supported by osgEarth, and then we have "competing" efforts like OSM/Autogen support, that is also overlapping with osgEarth - and then there are shader/effects like ALS which are really designed with the main scenery engine in mind. And at some point, someone will point out, that we also have Rembrandt somewhere in between :D

Determining if, and how, to integrate all these efforts is going to be a interesting challenge...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: osm2city.py development

Postby Thorsten » Tue Jun 10, 2014 11:08 am

Personally I have (at best) a 100k internet connection at home, so OSGEarth is just a non-issue for me.

I think the base ALS terrain shader could just be used for anything (works fine for models) - it's not really designed with anything in particular in mind, and even the advanced shaders would probably work just fine (including pixel prostprocessing and cloud shadows), after all the procedural texturing work is optional and xml-controlled.
Thorsten
 
Posts: 11441
Joined: Mon Nov 02, 2009 8:33 am

Re: osm2city.py development

Postby punkepanda » Tue Jun 10, 2014 10:13 pm

This is really nice work.. As long as we keep this 100% compatible out of the box, and not make it so it depends on ALS framework.
punkepanda
 
Posts: 237
Joined: Mon Nov 04, 2013 9:11 pm
Callsign: LostFlight
Version: 2.12
OS: Arch Linux

Re: osm2city.py development

Postby radi » Tue Jun 10, 2014 11:31 pm

Thorsten wrote in Mon Jun 09, 2014 3:10 pm:Hm... do you have the scenery tile for download somewhere?

This is Innsbruck scenery 2.0 plus one .ac model containing the roads, get it here here. I understand I could attach a shader to that .ac? Emilian said he has a traffic shader somewhere that I could test -- I'll probably do that first.
OSM buildings for LOWI, EDDC
Custom scenery for VHXX YMML
Edit .stg via the FG Object Placement Tool
radi
 
Posts: 643
Joined: Mon Aug 25, 2008 4:24 pm
Location: YMML, EDDC

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 1 guest