Closed devil-darkside closed 10 months ago
You didn't say what the problem is, but maybe this will help: https://docs.osgearth.org/en/latest/faq.html#lines-or-annotations-do-not-render
The problem is that the LineSymbol is not rendered. I think your comment is what I need. I'll try it.
GLUtils::setGlobalDefaults(camera->getOrCreateStateSet()) does not have any effect. I cannot see the outline of the Utah polygon. I've tried it with camera and with the area group.
I've tried again and I get always the same result. I tried also running ShaderGenerator on my node. I would like to render the stroke of the polygon, but if I create a graphic context by myself (Composite Viewer) there is no way to make it working. It only works if I use the "Standard Viewer".
I've found the issue.
It is not the graphic context but that the annotation group was not added under a Map node with
MapNode::get(root)->addChild(myArea);
but simply with
root->addChild(myArea);
So the annotation group was not direclty under a Map node.
There are still some render issues with lights but I do not need light to have effect on some node yet.
Ah, OK. Yes, annotations do need to under the MapNode
in order to correctly inherit information about the SRS and also some viewport/camera information the MapNode
makes available to shaders.
As for lighting - without looking at your code again - make sure your MapNode
is a child of your SkyNode
.
Hi, I tried to set some LineSymbol for a geometry in my code, see attached file.
osgearth_viewer_linesymbol.zip
If I put the following code to the osgearth_annotation application everything works.
I think there is something strange in how I create my GraphicContext.