As Remo suggests, the render-order symbol property will affect the order in which feature data renders, whether draped or not.
It simply calls setRenderBinDetails with a bin number; so, it is subject to any limitations of that OSG mechanism.
Draped features are implemented using a projected texture. So when the terrain surface renders, the draped geometry is texture mapped on top of the imagery each time a layer renders. If you only want the draped features to render once, consider using a FeatureImage layer instead -- it will rasterize your features into a normal ImageLayer.
TerrainEffect is a terrain-wide shader that runs when the engine renders each visible terrain surface layer. It will take effect after the engine draw the imagery and after it draws draped geometry.
So i understand that what i want is not possible... (render-order only sorts draped models between themselves).
Instead of a TerrainEffect is it possible to insert a ImageLayer between 2 draped layers ?
I did the following picture to describe what i want to achieve.
The option to render the elevation coloring part are:
- Use contourmap with little code modifications to set the color to red when necessary and to discard in other cases
- Use directly the elevation file as an imagelayer with coverage activated then write a shader
--> in all above solutions the pb is that the terraineffect or the image layer cannot be inserted between other draped layers
- Install a shader on the vector model layer (the lands) and find a way to access to the "oe_terrain_getElevation" function to color the layer as wishes...
- Maybe something with the stencil buffer to prevent drawing on the concerned regions ...