gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.51k stars 779 forks source link

render-order doesn't work with icon/text annotations #827

Closed remoe closed 7 years ago

remoe commented 7 years ago

Run osgearth_viewer with tests/feature_labels.earth:

image

after adding "render-order: 11;"

            <style type="text/css">              
                cities {
                    icon:           "../data/downarrow.png";
                    icon-placement: centroid;
                    icon-declutter: true;
                    icon-align:     center-bottom;
                    text-content:   [name];
                    text-priority:  [rank_max];
                    text-align:     center-bottom;
                    text-halo:      #3f3f3f;
                    text-size:      12+3*([rank_max]-9);
            render-order:      11;
                }     
            </style> 

image

the annotations are disappeared.

gwaldron commented 7 years ago

Yes, this is a conflict between the layer setting a render-order and the individual annotations activating the screen space layout. There is no easy fix. One possibility is to add a screen space layout option that sets the render bin number for all PlaceNode/LabelNodes.

remoe commented 7 years ago

But it also doesn't work when I set:

 icon-declutter: false
remoe commented 7 years ago

Fixed by: https://github.com/gwaldron/osgearth/commit/fd384fdb068b92387392fdfebe6a485744da8d6f