Canvas instancing

From FlightGear wiki
Jump to navigation Jump to search


This article is a stub. You can help the wiki by expanding it.
native Canvas map widget windows without any PUI (legacy GUI) involved, supporting multiple independent instances - good for quick regression testing, but also profiling and benchmarking
Screen shot showing multiple FG1000 instances; we don't currently have any way to set up Canvas MFD such that they can share sc::Element primitives or a whole scene graph between different instances of the same MFD.
Slightly extended Property Browser to show a preview for each Canvas for troubleshooting/debugging purposes, as per [1] This is a link to the FlightGear forum..Details at Canvas_MapStructure#The_SymbolCache


Cquote1.png not sure if we can share the canvas elements across displays, so I've made copies of everything for each display.[1]
— Richard
Cquote2.png
Cquote1.png Without some C++ level sharing of instanced elements, large numbers of complex (SVG path) symbols + DATA will be an issue. [...] Tom has mentioned a sprite cache for instancing, that would work great as a solution[2]
— James Turner
Cquote2.png
Cquote1.png Is it possible to duplicate a SVG element in Nasal? I'd like to draw a symbol only once in the SVG and then place multiple instances of it on my display. They need to be unique elements, as I'd like to animate them independently.[3]
— Gijs
Cquote2.png
Cquote1.png Unfortunately we have no way to share canvas::Elements between canvases - it's possible at the OSG level but not at any higher level that is exposed. So you probably end up just duplicating the paths and so on.[4]
— James Turner
Cquote2.png
Cquote1.png There are some things the Canvas / Map layer do which are not very performance-friendly, especially the symbol-caching / texture-atlasing can be managed better[5]
— James Turner
Cquote2.png


Cquote1.png I need to have some discussions with Tom about symbol instancing, since the vector symbols I'm doing for waypoints, VORs and so on should ideally be shared. I'll let Tom speak about his ideas for that.[6]
— James Turner
Cquote2.png


Cquote1.png I'm thinking about using a separate canvas for each symbol so that every instance of it is just a textured quad. For efficiency reasons it would be good to draw all symbols to a single canvas/texture and put all quads into a single node. So probably I'll add a new element type for putting quads into a single element which are all rendered at once. Maybe we can even use a geometry shader to just copy the positions to the GPU and generate the full quads with the shader. Ideas and suggestions are always welcome [7]
— Thomas Geymayer
Cquote2.png


References

References
  1. Richard (Sat Dec 19, 2015 3:12 pm). Space Shuttle.
  2. James Turner (Tue Oct 15, 2013 1:33 pm). Dynamic duplication of elements.
  3. Gijs (Tue Oct 15, 2013 1:33 pm). Dynamic duplication of elements.
  4. James Turner (2019-03-02 17:45:57). Performance of canvas image element?.
  5. James Turner (2016-12-10 18:22:26). Announcement: Remote canvas.
  6. James Turner (Mon Sep 24, 2012 1:13 pm). Using a canvas map in the GUI.
  7. Thomas Geymayer (Mon Sep 24, 2012 8:40 pm). Using a canvas map in the GUI.