Believe it or not, but that's a really good description - and it suggest that we might be "lucky" in that the issue might be specific to certain
Canvas elements (=rendering primitives), VORs being based on OpenVG (Shiva), would be in line with my previous working thesis, that certain elements (or element specific culling) could play a role here.
I would suggest to ignore the
Canvas map for now and see if you can trigger the same issue (crash/flickering) by running a self-contained
Canvas snippets using only certain rendering primitives (e.g.
Canvas.Text and
Canvas.Image specifically), if those don't crash/flicker, you've nailed down the issue down to OpenVG (
Canvas.
Path) handling, which would not be far-fetched at this point.
But again, checking if the issue disappears without using the integrated UI, would also go a long way, because then we know whether it's related to the creation of the OpenGL context by Qt5.
Sharing your config really is helpful, but I don't think you need any airports/scenery - you should be able to trigger the issue/crash by just executing one of the
Canvas examples:
If these two work without triggering the issue, native
OSG elements work properly:
https://wiki.flightgear.org/Canvas_snippets- Code: Select all
var (width,height) = (320,160);
var title = 'My new Window';
# create a new window, dimensions are WIDTH x HEIGHT, using the dialog decoration (i.e. titlebar)
var window = canvas.Window.new([width,height],"dialog").set('title',title);
# adding a canvas to the new window and setting up background colors/transparency
var myCanvas = window.createCanvas().set("background", canvas.style.getColor("bg_color"));
# Using specific css colors would also be possible:
# myCanvas.set("background", "#ffaac0");
# creating the top-level/root group which will contain all other elements/group
var root = myCanvas.createGroup();
# path is relative to $FG_ROOT (base package)
var path = "Textures/Splash1.png";
# create an image child for the texture
var child = root.createChild("image")
.setFile(path)
.setTranslation(100, 10)
.setSize(130, 130);
- Code: Select all
var (width,height) = (320,160);
var title = 'My new Window';
# create a new window, dimensions are WIDTH x HEIGHT, using the dialog decoration (i.e. titlebar)
var window = canvas.Window.new([width,height],"dialog").set('title',title);
# adding a canvas to the new window and setting up background colors/transparency
var myCanvas = window.createCanvas().set("background", canvas.style.getColor("bg_color"));
# Using specific css colors would also be possible:
# myCanvas.set("background", "#ffaac0");
# creating the top-level/root group which will contain all other elements/group
var root = myCanvas.createGroup();
var myText = root.createChild("text")
.setText("Hello world!")
.setFontSize(20, 0.9) # font size (in texels) and font aspect ratio
.setColor(1,0,0,1) # red, fully opaque
.setAlignment("center-center") # how the text is aligned to where you place it
.setTranslation(160, 80); # where to place the text
If the following snippet triggers the issue, the issue is specific/related to
Canvas.
Path handling:
- Code: Select all
var (width,height) = (320,160);
var title = 'My new Window';
# create a new window, dimensions are WIDTH x HEIGHT, using the dialog decoration (i.e. titlebar)
var window = canvas.Window.new([width,height],"dialog").set('title',title);
# adding a canvas to the new window and setting up background colors/transparency
var myCanvas = window.createCanvas().set("background", canvas.style.getColor("bg_color"));
# Using specific css colors would also be possible:
# myCanvas.set("background", "#ffaac0");
# creating the top-level/root group which will contain all other elements/group
var root = myCanvas.createGroup();
# change the background color
myCanvas.set("background", "#ffaac0");
# creating the top-level/root group which will contain all other elements/group
var root = myCanvas.createGroup();
var filename = "/Nasal/canvas/map/Images/boeingAirplane.svg";
var svg_symbol = root.createChild('group');
canvas.parsesvg(svg_symbol, filename);
svg_symbol.setTranslation(width/2,height/2);
#svg_symbol.setScale(0.2);
#svg_symbol.setRotation(radians)
EDIT: I tested these snippets locally in a non-Qt5 build, and cannot reproduce the issue at all - no flickering/no crashes whatsoever ...
Also, MapStructure is working as expected, too:
(pay attention to the
osg-stats and the threading modes shown there)
PS: I cannot say for sure whether the issue is really related to the Qt5 integration, but the observation would be in line with advice and recommendations on the
osg-users list, and also in line with comments shared by Edward, Emilian and others, who expressed previously concerns about
OSG/OpenGL contexts not created by
OSG, especially in the context of multi-threading. Personally, I cannot reproduce the issue in a non-Qt5 build.
And I suppose, Jules and Fernando might also be testing/developing using a non-Qt5 build (?)