TerraGear Documentation: Difference between revisions

Jump to navigation Jump to search
Line 135: Line 135:


=== genapts / genapts850 ===
=== genapts / genapts850 ===
The general approach that genapts uses this. Start with a simple square polygon representing the airport area. As we proceed and add shapes to the airport, they are subtracted from this initial polygon. Also start with an empty polygon representing the airport shapes. As we proceed, objects are "added" to this polygon. Then we iterate through all the runways and taxiways for the airport. For each 8.10 taxiway we draw the corresponding box. We "intersect" that box with the accumulated shape polygon, so we can only cover areas that haven't been covered already. Then we add this "intersected" shape to the airport shape polygon and subtract it from the enclosing polygon. We get to pick the order we process the airport surface objects, so we pick the runways first, and probably the biggest runways before the smaller runways. Then the bigger taxiways before the littler taxiways, etc. Biggest/most important to smallest, least important. In the end we have a jigsaw puzle of all the individual shapes (so we can texture them properly individually) as well as a master surrounding polygon with holes cut out for all the shapes, plus a master polygon of all the shapes. Then in the end we can cover the whole area perfectly with no overlaps and no seams. In addition, there is a fairly sophisticated (and I think cool) step where we fit a natural curved surface across the airport elevation and used the curved surface instead of raw SRTM points. This eliminates the "noise" in the raw data and gives the airport surface a natural looking slope and correct hills and valleys (in most cases.) After that we generate all the light points and adjust their height based on the fitted curved surface. I think this approach could be updated for the 8.5 format by just generating different polygon shapes instead of the older collection of rectangles. The down side to the current approach is that it's hard to add markings over the surface. Without getting into all the technical details, if you cut in the markings into the surface structure you end up with an incredibly complex shape with an incredible number of triangles. Bad for load speeds and rendering speeds. If you lay the runway / taxiway markings and skid marks over the top of the base surface, then you have a lot of issues with z-buffer fighting and other odd graphics artifacts. Because our runway surface is curved/sloped we just use a simple draw order trick like other sims might use. But maybe in the past few years people have developed better tricks and techniques for handling this difficult problem of adding complex / arbitrary markings to a surface in a way that looks good mostly edge on (when landing or taxiing) and doesn't blow up your polygon count or encounter z-buffer problems, or require odd hacks of lifting the markings high enough above the runway that you can start to see that they are actually floating and not attached. <ref> {{cite web
  | url    = http://sourceforge.net/p/flightgear/mailman/message/28066427/
  | title  = <nowiki>Re: [Flightgear-devel] New experimental mapserver</nowiki>
  | author = <nowiki>Curtis Olson</nowiki>
  | date  = Sep 9th, 2011
  | added  = Sep 9th, 2011
  | script_version = 0.25
  }}
</ref>
<references/>


==== design ====
==== design ====

Navigation menu