TerrainEffect and Drape

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

TerrainEffect and Drape

Hi,

I need to orgonize my layers orders such as one draped layer is drawn first, then one terraineffect, then other draped layers.

How can i achieve this?

Thanks,
JD
remoe remoe
Reply | Threaded
Open this post in threaded view
|

Re: TerrainEffect and Drape

Hi

Try to use "render-order".

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

Re: TerrainEffect and Drape

As Remo suggests, the render-order symbol property will affect the order in which feature data renders, whether draped or not.

styleName {
   render-order: 5;
}

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.

Hope this helps.
Glenn Waldron / Pelican Mapping
JD JD
Reply | Threaded
Open this post in threaded view
|

Re: TerrainEffect and Drape

Thank you for your answers.

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 ?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: TerrainEffect and Drape

No. Draped geometry renders with with every ImageLayer as it is being drawn (as a secondary bound texture).
Glenn Waldron / Pelican Mapping
JD JD
Reply | Threaded
Open this post in threaded view
|

Re: TerrainEffect and Drape

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 ...

Any ideas?