osgearth 2.10 graticules

classic Classic list List threaded Threaded
3 messages Options
jlarsen jlarsen
Reply | Threaded
Open this post in threaded view
|

osgearth 2.10 graticules

Hello,

I figured I'd start a new thread on this.  There seems to be an issue using both the skynode and mgrs/gars graticules in osagearth 2.10.  I'm using osg-3.6.3 for reference.

It seems like the only sample that uses the skynode is osgearth_eci.  If you load the graticules.earth map with either the gars or mgrs graticule set to visible, the labels will not render.



I changed the MGRSGraticuleOptions and MGRSGraticule code to use an option for which coords the osgText uses rather than the #define blocks and if you force it to use OBJECT_COORDS (by adding <use_screen_coords>false</use_screen_coords> to the mgrs_graticule node in the map file), the labels will render.

Our application was failing in the same way and the issue was corrected with my changes to force the labels to use OBJECT_COORDS.



However, in our application, I cannot figure out why GARS lines are NOT rendering.  The labels do, but the performance is really bad.  In debug, labels pop in and out, like draw calls are being dropped.  In release they seem pretty stable, but again - no gars lines visible.  The GARS lines DO draw in the osgearth_eci sample, but the labels do not.  I suspect that if I added an option to force OBJECT_COORDS, that would correct that, but it is baffling me why the problem is inverse in our application.

I'm curious if someone with more experience with these things might chime in.  I'm including the diff for my changes to MGRSGraticule for reference.  The change on line 94 of MGRSGraticule.cpp is because using the LineGroup causes a crash if you pass a LineSegmentInteresector to a map with that MGRSGraticule.  This is easy to reproduce in the samples and I can include a diff for that too if someone would like.

Thank you,

Joel

P.S. I'm happy to submit a PR for these fixes.  I'm just waiting for feedback and insight into my issue with GARS lines (and performance, if possible).

mgrs.h_diff
mgrs.cpp_diff
jlarsen jlarsen
Reply | Threaded
Open this post in threaded view
|

Re: osgearth 2.10 graticules

I got our GARS lines rendering.  I had to add an option to disable the use of draping.  I'd like to better understand what is happening if anyone cares to chime in.

In GARSGraticule::init() I changed it to the following:

    if (options().useDraping().value())
    {
        // Note: since we use draping we do NOT need to activate a horizon clip plane!
        options().style()->getOrCreateSymbol<AltitudeSymbol>()->clamping() = AltitudeSymbol::CLAMP_TO_TERRAIN;
        options().style()->getOrCreateSymbol<AltitudeSymbol>()->technique() = AltitudeSymbol::TECHNIQUE_DRAPE;
    }

Now to go back to figuring out why our MGRS labels only render when using OBJECT_COORDS instead of SCREEN_CORDS!


Thank You,

Joel
Josiah425 Josiah425
Reply | Threaded
Open this post in threaded view
|

Re: osgearth 2.10 graticules

I'm getting the same issue where graticule labels don't render in 2.10, but do in 2.9.  I appreciate your fix in the meantime.