Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The earth globe appears weird when adding a SkyNode #2420

Open
virtuozo007 opened this issue Jan 11, 2024 · 1 comment
Open

The earth globe appears weird when adding a SkyNode #2420

virtuozo007 opened this issue Jan 11, 2024 · 1 comment
Labels
defect It's busted

Comments

@virtuozo007
Copy link

I encountered a strange problem when adding a SkyNode onto the globe, which has bothered me for several days.
The problem is that if I don't add the sky node, everything works fine, but after I add the sky node, the problem in the picture below appears. There are something like longitude and latitude lines on the earth, still with some red/green/yellow triangle faces.
(I removed the earth file to better visualize the problem.)
image

The osgearth_viewer.exe application has the same problem too, as belows:
image

The codes i used to initial the earth viewer were very simple:

osgEarth::Util::SkyNode* m_pSkyNode = osgEarth::Util::SkyNode::create(skyOptions);
m_pSkyNode->setName("SkyNode");
m_pSkyNode->setEphemeris(ephemeris);
m_pSkyNode->setDateTime(dateTime);
pViewer->setLightingMode(osg::View::SKY_LIGHT);
m_pSkyNode->attach(pViewer, 0);
m_pSkyNode->setLighting(true);
m_pSkyNode->setAtmosphereVisible(false);
m_pSkyNode->addChild(mapNode);
root->addChild(m_pSkyNode);

There is another interesting thing, If I comment out the codes bellow which i added in the main.cpp before the QApplication's Constructor:

       QSurfaceFormat format = QSurfaceFormat::defaultFormat();
   #ifdef OSG_GL3_AVAILABLE
       format.setVersion(3, 2);
       format.setProfile(QSurfaceFormat::CoreProfile);
       format.setRenderableType(QSurfaceFormat::OpenGL);
       format.setOption(QSurfaceFormat::DebugContext);
       qDebug() << QObject::tr("OPENGL3");
   #else
       format.setVersion(2, 0);
       format.setProfile(QSurfaceFormat::CompatibilityProfile);
       format.setRenderableType(QSurfaceFormat::OpenGL);
       format.setOption(QSurfaceFormat::DebugContext);
       qDebug() << QObject::tr("OPENGL2");
   #endif
       format.setDepthBufferSize(24);
       //format.setAlphaBufferSize(8);
       format.setSamples(8);
       format.setStencilBufferSize(8);
       format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
       QSurfaceFormat::setDefaultFormat(format);

The longitude and latitude lines thing disappear, but the red/green/yellow triangle faces still remains :
image

So, maybe it's a bug about OpenGL , I guess?

My compiling environments:
Windows 11 , VS 2019, vcpkg

Here is the osgearth version information:
[osgearth info] [Capabilities] osgEarth Version: 3.5.0 build 149
[osgearth info] [Capabilities] GDAL Version: 3.8.2
[osgearth info] [Capabilities] OSG Version: 3.6.5
[osgearth info] [Capabilities] OSG GL3 Features: yes
[osgearth info] [Capabilities] OSG FFP Available: no
[osgearth info] [Capabilities] CPU Cores: 12
[osgearth info] [Capabilities] GL_VENDOR: NVIDIA Corporation
[osgearth info] [Capabilities] GL_RENDERER: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2
[osgearth info] [Capabilities] GL_VERSION: 3.3.0 NVIDIA 546.33
[osgearth info] [Capabilities] GL CORE Profile: yes

I am really confused on this.
Has anyone encountered the same problem? Please help me, many thanks!

@virtuozo007 virtuozo007 changed the title The earth globe appears werrid when adding a SkyNode The earth globe appears weird when adding a SkyNode Jan 11, 2024
@virtuozo007
Copy link
Author

If i comment out the QSurfaceFormat codes, the stars in the sky disappear too, but the sun remains.

@gwaldron gwaldron added the defect It's busted label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect It's busted
Projects
None yet
Development

No branches or pull requests

2 participants