Placenodes are shaking (!)

classic Classic list List threaded Threaded
8 messages Options
JD JD
Reply | Threaded
Open this post in threaded view
|

Placenodes are shaking (!)

Sometimes, with a very rare occurence, all placenodes "shakes" in a perimeter of 1 pixel (one move per frame).
I tried the snap_pixel option with the same result.
I dont have a scenario to reproduce it as it is very occasional and seems random.

Have you ever had this problem? Any ideas for correcting?

Osg 3.4.1
OsgEarth 2.9 with few patches
(Continuous paint)
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Placenodes are shaking (!)

JD,
Too much coffee?

I haven't seen this, but if you manage to isolate a repro case let us know.
Glenn Waldron / Pelican Mapping
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Placenodes are shaking (!)

In reply to this post by JD
JD,
By any chance do you see this while using the EarthManipulator's tether?
Glenn Waldron / Pelican Mapping
JD JD
Reply | Threaded
Open this post in threaded view
|

Re: Placenodes are shaking (!)

Unfortunately it is not linked to the tether mode.
I managed to reproduce it with feature_labels example but still not have a scenario.
I am adding traces to understand what is the data that moves (geotransform result? mvp multiplication? ...)

Along with this investigation i am trying to understand another pb in screespacelayout: sometimes the bboxdrawable of a placenode is drawn after the text; it is like it does not fall into the «same parent» branch of the sorting algorithm and then (using depth criteria) z-fighting happens...
remoe remoe
Reply | Threaded
Open this post in threaded view
|

Re: Placenodes are shaking (!)

Hi

Is it possible to create a sample earth file with all your styles you use? And do you tried it with >= OSG 3.5.9? You have applied patches on osgEarth? Which one?

Cheers,
Remo Eichenberger, Switzerland
JD JD
Reply | Threaded
Open this post in threaded view
|

Re: Placenodes are shaking (!)

After many days of investigation :

- When the placenodes "shake" without any camera movement, i can see that their leaf modelview matrix changes each frame. What I can see in the values is that they change between a "pure" float value with a lot of digits after the comma AND a value that always finishes with '.5'. This '.5' is the result of the "quantize/snaptopixel" calculation. The problem, when occurs, is that the condition "if ( quantize && !camChanged )" passes one in two. The tests show that when the problem occurs the condition camChanged changes its value each frame ! (true, false, true, false, true ...). I didn't find for the moment the reason of why "camVPW != local._lastCamVPW;" does not work... I think that there is an issue in the management of the _perCam map... For my project i simply set snapToPixel to false and it works and i don't see any problems about the characters rendering.

- About the bboxdrawable that is sometimes displayed after the text (then it hides it) I am starting to understand what happens. Globally it is a problem related to the _depth value of the leaves. A first patch must be done in "SortFrontToBackPreservingGeodeTraversalOrder" for the case where sortByPriority is not active. The equality of depth is not tested and if there are many placenodes with exactly the same depth (it can occur!) the sort algorithm can separate the bbox and its associated text (the "same parent" condition will not be systematically evaluated depending on the order the drawables are). The code that is in "SortByPriorityPreservingGeodeTraversalOrder" must be used instead (check traversal order when depth are equal). But even with this patch, the sort algorithm will "fail" in some cases. It is when the depths of bbox and text (or icon and text) are not the same AND if the depth order between both is not the one we expect with the geode order. I did not manage to have a quick fix. Possible fixes i have in mind:
    - Merge bbox and text into the same drawable (it will also improve the culling performance but it will not help for placenodes composed of icon and text)
    - OR find a way for forcing the depth values of all drawable of a given geode to be the same
    - OR Do a first sort based on geode depth and not on drawable, then sort again this list to respect the traversal order under a given geode.

- I noticed also that the placenode always creates a text even if the text symbol is not defined (for only displaying an icon for example). "createTextDrawable" shall be called only when necessary.

I lost some hairs with that investigation!
My intention is to implement a drawable that supports both bbox and text (like OSG does), but i don't have a roadmap for that today.

The quick fixes will be pushed soon on our fork.

JD.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Placenodes are shaking (!)

JD, let me know when you post your fixes so we can take a look. Thanks for your efforts on this.
Glenn Waldron / Pelican Mapping
JD JD
Reply | Threaded
Open this post in threaded view
|

Re: Placenodes are shaking (!)

Build a osg::Text only if TextSymbol is present:
https://github.com/JD31/osgearth/commit/8558430fa80a59eb059a9468d28967644efe758d

Improve sort algorithm to avoid a bad order when drawables have same depth:
https://github.com/JD31/osgearth/commit/9c95b874ff5ea1e3f87ec1991f541f830e02f130

I will share if i commit something new.

Bye.