osgEarth::Registry::capabilities() cause a black screen

classic Classic list List threaded Threaded
5 messages Options
ytyisme ytyisme
Reply | Threaded
Open this post in threaded view
|

osgEarth::Registry::capabilities() cause a black screen

When I only use osg in qml, everything is normal. If I add the earth node to the scene, it will cause a black screen.
I added QQuickFramebufferObject to the scene as a node of qml.

In the render phase, I found that OSGEarth::Registry::Capabilities() built a temporary context to obtain the current environment's support for OpenGL.

There is already an active device context in the rendering stage. Call OSGEARTH::REGISTRY::Capabilities() to check the environment whether it is necessary and why not directly inquires through OpenGL function.
vs2015 osgEarth3.0 osg3.7.0
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth::Registry::capabilities() cause a black screen

Try calling osgEarth::Registry::capabilities() before initializing your Qt environment. If you are using the osgEarth 3.0 branch, you can include "osgEarth/Common" and call osgEarth::initialize() instead.
Glenn Waldron / Pelican Mapping
ytyisme ytyisme
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth::Registry::capabilities() cause a black screen

Thank you very much for your reply.
I added osgEarth::Registry::capabilities() to the first line of the main function in qml's program. It is normal.

1. Is it necessary to set the DefaultFboId when using osgearth RTTPicker DrapeableNode ?
m_osgViewer->getCamera()->getGraphicsContext()->setDefaultFboId(this->framebufferObject()->handle());
framebufferObject() is qml's object

2. I added rotation to mapnode to simulate the earth's rotation. But when I added a rotation to mapnode, DrapeableNode was not in my bound range.Is it because DrapeableNode uses textureProj?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth::Registry::capabilities() cause a black screen

Yes, you need to call setDefaultFboId so that OSG doesn't override Qt's main FBO.

There are some things in osgEarth that don't work correctly when you transform the MapNode. Feel free to enter a GitHub issue when you find something.
Glenn Waldron / Pelican Mapping
ytyisme ytyisme
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth::Registry::capabilities() cause a black screen

Thank you very much for your reply.