Missing parts of rendered features when map is disabled

classic Classic list List threaded Threaded
2 messages Options
krzysief krzysief
Reply | Threaded
Open this post in threaded view

Missing parts of rendered features when map is disabled

like in the title, without map my drawed circles are somehow collapsed inside earth while with map they seem ok.
I am using osgearth 2.9
My code and screenshots below:

Symbology::GeometryFactory geometry_factory(mapNode->getMapSRS());
ref_ptr<osgEarth::Geometry> geometry = geometry_factory.createCircle(position, osgEarth::Linear(radius, osgEarth::Units::METERS), 52);
ref_ptr<Features::Feature> feature = new osgEarth::Features::Feature(geometry, mapNode->getMapSRS());

ref_ptr<RenderSymbol> render_symbol = feature->style()->getOrCreateSymbol<RenderSymbol>();
        render_symbol->order() = order_counter;
        render_symbol->depthTest()   = false;
        render_symbol->transparent()   = false;
        render_symbol->decal()   = true;

        DepthOffsetOptions depth_offset_options;
        depth_offset_options.enabled()      = true;
        depth_offset_options.automatic()    = true;
        depth_offset_options.minBias()      = 1.1f;
        depth_offset_options.maxBias()      = 70.0f;

        render_symbol->depthOffset()        = depth_offset_options;

ref_ptr<AltitudeSymbol> altitude = feature->style()->getOrCreate<osgEarth::Symbology::AltitudeSymbol>();
        altitude->clamping() = osgEarth::Symbology::AltitudeSymbol::CLAMP_TO_TERRAIN;
        altitude->binding() = osgEarth::Symbology::AltitudeSymbol::BINDING_VERTEX;
        altitude->technique() = osgEarth::AltitudeSymbol::TECHNIQUE_SCENE;
        altitude->verticalOffset() = 1000;

ref_ptr<LineSymbol> line = feature->style()->getOrCreate<osgEarth::Symbology::LineSymbol>();
        line->stroke()->color() = color;
        line->stroke()->width() = width;
        line->stroke()->widthUnits() = osgEarth::Units::PIXELS;

ref_ptr<FeatureNode> circleNode = new FeatureNode(mapNode, feature);

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view

Re: Missing parts of rendered features when map is disabled

Generally, filled polygons are difficult to render properly in 3D unless you use draping (altitude-clamping: terrain-drape).

If you can reproduce this in an earth file it will be easier for us to reproduce and comment on.
Refer to annotation.earth for examples.
Glenn Waldron / Pelican Mapping