Canvas tile element: Difference between revisions

m
can be implicitly implemented by integrating Compositor and CompositeViewer Support in the form of a Canvas View element rendering an orthographic view: Hackathon Proposal: CompositeViewer and Canvas
m (https://www.mail-archive.com/flightgear-devel@flightgear.org/msg16345.html)
m (can be implicitly implemented by integrating Compositor and CompositeViewer Support in the form of a Canvas View element rendering an orthographic view: Hackathon Proposal: CompositeViewer and Canvas)
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{FGCquote|1=I'd really like to use the Atlas generated maps as a layer in the browser map. Is anybody out there looking for an adventure and is able to modify the Atlas map generator to generate maps on-the-fly?|2= {{cite web  | url    = https://forum.flightgear.org/viewtopic.php?f=31&t=21972&p=203544&#p203495  | title  = <nowiki>Re: Atlas still in use?</nowiki>  | author = <nowiki>Torsten</nowiki>  | date  = Mon Mar 17, 2014 8:56 pm  }}}}
{{Affected by|article=Hackathon Proposal: CompositeViewer and Canvas|work=Integrating CompositeViewer Suppport and Compositor via a dedicated Canvas View element to render orthographic views to a Canvas|details=Post_FlightGear_2020.2_LTS_changes#Canvas}}
 
[[File:787-8-terrain-map.jpeg|thumb|300px|Early Terrain radar emulation (from the 787-8)]]
 
{{FGCquote
|1=
Drawing an entire image via setPixel calls from Nasal will also be slow [...] I would suggest, it might be better to make these special image layers which are computed by C++ code, so they can be updated efficiently.|2= {{cite web
  |url    =  https://sourceforge.net/p/flightgear/mailman/message/36483136/
  |title  =  <nowiki> [Flightgear-devel] Feature request: Canvas dynamic image from Nasal</nowiki>
  |author =  <nowiki> James Turner </nowiki>
  |date  =  2018-12-02 11:16:35
  |added  =  2020-06-19 
  |script_version = 0.50
  }}
}}
 
 
{{FGCquote
|1=
Once you get to the extra features (of modern avionics), like FIS-B weather or TIS-B traffic info over ADS-B, or {{Wikipedia|TAWS}} (terrain alerting), we're probably in way over our heads trying to emulate even the simplest general-aviation IFR GPS.
|2= {{cite web
  |url    =  https://sourceforge.net/p/flightgear/mailman/message/35924395/
  |title  =  <nowiki> [Flightgear-devel] RFD: FlightGear and the changing state of air navigation </nowiki>
  |author =  <nowiki> David Megginson </nowiki>
  |date  =  Jul 3rd, 2017
  |added  =  Jul 3rd, 2017
  |script_version = 0.39
  }}
}}
 
{{FGCquote
  |A moving map is a different beast. It would make sense to implement that as a  scene graph in its own right with its own pager. That would require a change in current fg architecture to use a [[CompositeViewer Support|CompositeViewer]] instead of a single Viewer, but we're contemplating that anyway.
  |{{cite web |url=https://sourceforge.net/p/flightgear/mailman/message/20014126/
    |title=<nowiki>[Flightgear-devel] Cockpit displays (rendering, modelling)</nowiki>
    |author=<nowiki>Tim Moore</nowiki>
    |date=<nowiki>2008-08-04 09:43:37</nowiki>
  }}
}}
 
{{FGCquote|1=I'd really like to use the [[Atlas]] generated maps as a layer in the browser map. Is anybody out there looking for an adventure and is able to modify the Atlas map generator to generate maps on-the-fly?|2= {{cite web  | url    = https://forum.flightgear.org/viewtopic.php?f=31&t=21972&p=203544&#p203495  | title  = <nowiki>Re: Atlas still in use?</nowiki>  | author = <nowiki>Torsten</nowiki>  | date  = Mon Mar 17, 2014 8:56 pm  }}}}


{{Stub}}
{{Stub}}


[[File:Atlas.jpg|thumb|270px|Atlas map view of the San Francisco bay area]]
[[File:Atlas.jpg|thumb|270px|Atlas map view of the San Francisco bay area]]
{{See also|Complex Canvas Avionics}}


Some contributors have been experimenting with atlas based moving map displays (with pre-rendered Atlas images), but with nasal code.<ref>https://sourceforge.net/p/flightgear/mailman/message/20010870/</ref> <ref>https://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg33880.html</ref>
Some contributors have been experimenting with atlas based moving map displays (with pre-rendered Atlas images), but with nasal code.<ref>https://sourceforge.net/p/flightgear/mailman/message/20010870/</ref> <ref>https://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg33880.html</ref>
Line 9: Line 50:
The nice thing about Atlas is that it uses the current FlightGear scenery for generating it's maps. If we get better scenery, Atlast produces better maps.<ref>https://www.mail-archive.com/flightgear-devel@flightgear.org/msg16345.html</ref>
The nice thing about Atlas is that it uses the current FlightGear scenery for generating it's maps. If we get better scenery, Atlast produces better maps.<ref>https://www.mail-archive.com/flightgear-devel@flightgear.org/msg16345.html</ref>


James originally implemented the a moving navigational [[Map]] as a custom PUI widget - it's *not* an Atlas-replacement, or an MPMap replacement, i.e. not intended to also display terrain elevation <ref>https://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg27097.html</ref>
This issue of not being able to render maps to a sub window is coming back to bite us every time. If it's not stuff like this then it's moving map/GPS/ND type instruments. <ref>https://www.mail-archive.com/flightgear-devel@flightgear.org/msg30262.html</ref>
 
James originally implemented the a moving navigational [[Map]] as a custom [[PUI]] widget - it's *not* an Atlas-replacement, or an [[MPMap]] replacement, i.e. not intended to also display terrain elevation <ref>https://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg27097.html</ref>


An Atlas-  style renderer as another layer is possible, it'd also let me build the one GUI element I've been wanting for ages, a 'map' dialog box with navaids and airways overlaid, like the map UIs in MSFS / X-Plane / Fly. <ref>https://sourceforge.net/p/flightgear/mailman/message/20012110/</ref>
An Atlas-  style renderer as another layer is possible, it'd also let people builda 'map' dialog box with navaids and airways overlaid, like the map UIs in MSFS / X-Plane / Fly. <ref>https://sourceforge.net/p/flightgear/mailman/message/20012110/</ref>


In order to feed imagery from tools like Atlas or moving maps in general from a network server, you'd want to look at protocols like WMS and the servers which
In order to feed imagery from tools like Atlas or moving maps in general from a network server, you'd want to look at protocols like WMS and the servers which
Line 19: Line 62:


== Intro ==
== Intro ==
[[File:Zkv1000.jpg|thumb|250px|The [[FlightGear Newsletter October 2010|zkv 1000]] glass cockpit project (2010)]]
tiled web maps are obviously great for many reasons, but people without a broadband internet connection may still want to use a different tool, or even an offline solution in general.
tiled web maps are obviously great for many reasons, but people without a broadband internet connection may still want to use a different tool, or even an offline solution in general.
And like I said, there is the issue of mismatching data - FlightGear has never been particularly good at this, but there is now an increasing tendency to rely on "online functionality", i.e. there is a growing assumption that people do have an internet connection, and that they're online while using FlightGear - depending on whom you ask, that is not just controversial, but increasingly problematic.
And like I said, there is the issue of mismatching data - FlightGear has never been particularly good at this, but there is now an increasing tendency to rely on "online functionality", i.e. there is a growing assumption that people do have an internet connection, and that they're online while using FlightGear - depending on whom you ask, that is not just controversial, but increasingly problematic.
Line 38: Line 82:


== Problem ==
== Problem ==
[[File:Canvas - Tile map demo.png|thumb|A simple, canvas based tile map which is centered around the aircraft.]]
[[File:StuartsSlippyMap4.png|thumb|MapStructure OSM (OpenStreetMap) layer created by Stuart for his ongoing [[FG1000]] effort]]
Thanks to the Canvas system, we now have an increasing number of MFDs/avionics that use so called "slippy" maps - there remains the obvious issue that such a "slippy map" will usually be based on very different geo data than FlightGear's terrain (i.e. mismatching data).<ref>https://forum.flightgear.org/viewtopic.php?p=364640#p364640</ref>
Thanks to the Canvas system, we now have an increasing number of MFDs/avionics that use so called "slippy" maps - there remains the obvious issue that such a "slippy map" will usually be based on very different geo data than FlightGear's terrain (i.e. mismatching data).<ref>https://forum.flightgear.org/viewtopic.php?p=364640#p364640</ref>


Line 43: Line 92:


More and more Airports that have different airport data on the FG Map & Route Manager. Route Manager data seems to agree with other map sources like Sky Vector. Does FG Map get updated from independent sources like Sky Vector & others.<ref>https://forum.flightgear.org/viewtopic.php?f=25&t=37589&p=369707#p369705</ref>
More and more Airports that have different airport data on the FG Map & Route Manager. Route Manager data seems to agree with other map sources like Sky Vector. Does FG Map get updated from independent sources like Sky Vector & others.<ref>https://forum.flightgear.org/viewtopic.php?f=25&t=37589&p=369707#p369705</ref>
== About setPixel() ==
Drawing an entire image via setPixel calls from Nasal (for terrain / wxr radar overlays by any chance?) will also be slow, in which case, it might be better to make these '''special image layers''' which are computed by C++ code, so they can be updated efficiently.<ref>https://sourceforge.net/p/flightgear/mailman/message/36483136/</ref>
Obviously, it's a valid use-case, i.e. creating a ‘scanned’ terrain radar, WXR or similar overlays on Canvas, no argument there, where defining a raster via paths is pretty heavyweight for frequent updating.
<ref>https://sourceforge.net/p/flightgear/mailman/message/36483231/</ref>
For features like:
* Inverse synthetic-aperture radar
* Synthetic-aperture radar
* Ground radar
* Ground radar for moving objects
But once we got capability for modifying canvas images real-time or through some other method like fragment shader, it will be usable for many things, for example wxr radar etc etc.<ref>https://sourceforge.net/p/flightgear/mailman/message/36484679/</ref>
Originally, radar altimeter was a big CPU hit, because it does a ‘scanned’ set of 3D ground intersections (over a range of angles in two axes) at the full FDM rate (120Hz), and this becomes significant number of triangle intersections.<ref>https://sourceforge.net/p/flightgear/mailman/message/36484933/</ref>
This kind of feature would be the prerequisite to get a working TERRain mode on the 737 MAP display.<ref>https://sourceforge.net/p/flightgear/mailman/message/36579110/</ref>


== Status ==
== Status ==
'''07/2020'''
'''07/2020'''
{{Note|This can already be done by treating the tile as a 3D model and rendering an orthogonal projection of the tile(s), and using the patch from [[Howto:Extending Canvas to support rendering 3D models]]}}


RFC (idea/feature request frequently discussed on the devel list and forum)
RFC (idea/feature request frequently discussed on the devel list and forum)
Line 54: Line 129:
FlightGear uses very outdated navigational data - whereas online sources (chart providers) use different data.
FlightGear uses very outdated navigational data - whereas online sources (chart providers) use different data.


To solve this, you need to use the same underlying data source.
To solve this, we need to use the same underlying data source.


The most straightforward option would be to procedurally render our own charts using the map/atlas tools, and use those internally, without relying on 3rd party sources, and online web services:
The most straightforward option would be to procedurally render our own charts using the map/atlas tools, and use those internally, without relying on 3rd party sources, and online web services.


== Motivation ==
== Motivation ==
Line 83: Line 158:


== Pointers ==
== Pointers ==
{{See also|BTG file format}}
{{See also|BTG file format|Tile Index Scheme}}
<!--
<!--
FIXME should be using repo URL templates
FIXME should be using repo URL templates
Line 92: Line 167:
* https://sourceforge.net/p/flightgear/simgear/ci/next/tree/simgear/scene/tgdb/ReaderWriterSTG.cxx
* https://sourceforge.net/p/flightgear/simgear/ci/next/tree/simgear/scene/tgdb/ReaderWriterSTG.cxx
* https://sourceforge.net/p/flightgear/simgear/ci/next/tree/simgear/scene/tgdb/SGReaderWriterBTG.cxx
* https://sourceforge.net/p/flightgear/simgear/ci/next/tree/simgear/scene/tgdb/SGReaderWriterBTG.cxx
* [[Fgelev]]
* [[Canvas Image]]
* [[Canvas Image]]