Board index FlightGear Development Canvas

initNasalCanvas() - making Canvas optional

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

initNasalCanvas() - making Canvas optional

Postby Hooray » Tue Nov 24, 2015 10:50 am

We are seeing an increasing number of threads where Nasal/Canvas overhead is discussed:

Subject: the real cost of the Nasal Garbage Collector
Richard wrote:ImageThe results are interesting; as the only time we drop below 60fps is when Nasal is active, and the canvas displays are powered on and updating; in which case the frame rate drops to 51.3fps. If anything the maximum effect I'm seeing is a drop from 91fps to 75fps in comparable situation when Nasal is unloaded.

It would make sense for the Canvas subsystem to be fully optional (at startup via property switch) and removable (using the remove-subsystem fgcommand). The corresponding cppbind bindings should be added/removed dynamically via the bind/unbind methods to ensure that we don't clutter the namespace with stuff that is not even running.

This will greatly simplify any future troubleshooting/benchmarking efforts - and we could/should also add dedicated draw masks for Canvas placements (gui, cockpit, scenery) - and maybe even allow placements to be annotated with a drask-mask name, so that custom MFDs can be easily disabled using the same /sim/rendering/draw-mask method, probably with a canvas sub-branch in it.

It would be trivial for us to change the addPlacement() calls to .set("draw-mask-name", "captain-pfd") - at which point, the whole thing would register a osg::switch for the placement (camera)
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,
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Posts: 12053
Joined: Tue Mar 25, 2008 8:40 am

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest