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 function setVisible of FeatureModelLayer is invalid #2605

Open
zyxgis opened this issue Aug 13, 2024 · 2 comments
Open

the function setVisible of FeatureModelLayer is invalid #2605

zyxgis opened this issue Aug 13, 2024 · 2 comments
Assignees
Labels
defect It's busted

Comments

@zyxgis
Copy link

zyxgis commented Aug 13, 2024

i use vcpkg toolchain to compile osgearth

this is my osgearth's version infos:

osgearth_versiond.exe --caps
[osgearth info] Hello, world.
[osgearth info] [Capabilities] osgEarth Version: 3.6.0 build 158
[osgearth info] [Capabilities] GDAL Version: 3.9.0
[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: Intel
[osgearth info] [Capabilities] GL_RENDERER: Intel(R) UHD Graphics 630
[osgearth info] [Capabilities] GL_VERSION: 3.3.0 - Build 31.0.101.2127
[osgearth info] [Capabilities] GL CORE Profile: yes
[osgearth info] Goodbye.

my codes is :

osgEarth::OGRFeatureSource *featureSource = new osgEarth::OGRFeatureSource();
featureSource->setName("vector-1");
featureSource->setURL("E:/osgearth/data/world.shp"); // 
//this->getMapNode()->getMap()->addLayer(featureSource);
//
osgEarth::Style style;
style.getOrCreateSymbol<osgEarth::LineSymbol>()->stroke().mutable_value().color() = osgEarth::Color::Yellow;
style.getOrCreateSymbol<osgEarth::LineSymbol>()->stroke().mutable_value().width() = 2.0f;
style.getOrCreateSymbol<osgEarth::LineSymbol>()->tessellationSize() = osgEarth::Distance(100, osgEarth::Units::KILOMETERS);
style.getOrCreate<osgEarth::AltitudeSymbol>()->clamping() = osgEarth::AltitudeSymbol::CLAMP_TO_TERRAIN;
style.getOrCreate<osgEarth::AltitudeSymbol>()->technique() = osgEarth::AltitudeSymbol::TECHNIQUE_GPU;
style.getOrCreate<osgEarth::RenderSymbol>()->depthOffset().mutable_value().enabled() = true;
//
osgEarth::FeatureModelLayer *featureModelLayer = new osgEarth::FeatureModelLayer();
featureModelLayer->setFeatureSource(featureSource);
osgEarth::StyleSheet *styleSheet = new osgEarth::StyleSheet();
styleSheet->addStyle(style);
featureModelLayer->setStyleSheet(styleSheet);
featureModelLayer->setName(filename);
this->getMapNode()->getMap()->addLayer(featureModelLayer);

......

featureModelLayer->setVisible(false);  // the setVisible function is invalid, the featureModelLayer is still visible.
@gwaldron
Copy link
Owner

Unfortunately I am unable to reproduce this due to the crash when using TECHNIQUE_GPU.
I would recommend avoiding that option though; try TECHNIQUE_DRAPE instead.

@gwaldron
Copy link
Owner

I believe the problem here is a conflict between the VisibleLayer's culling callback (which permits culling to happen even when a layer is invisible) and the ClampableNode/DrapeableNode (which don't add leaves to the normal render graph during cull).

@gwaldron gwaldron added the defect It's busted label Aug 26, 2024
@gwaldron gwaldron self-assigned this Aug 26, 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