Adjust shared ImageLayer at runtime

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

Adjust shared ImageLayer at runtime

Hi all,

I am using a shared ImageLayer for masking, just as suggested in the osgearth_sharedlayer example. Now I want to change the mask at runtime.

Is it possible to adjust the ImageLayer accordingly or do I need to create an ImageLayer each time when change occured?

Thanks!

\Boy2melo
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Adjust shared ImageLayer at runtime

A shared layer is like any other ImageLayer. Your best bet will be to recreate the layer anew if the source data changes.
Glenn Waldron / Pelican Mapping
boy2melo boy2melo
Reply | Threaded
Open this post in threaded view
|

Re: Adjust shared ImageLayer at runtime

Hi gwaldron,

thank you for your answer.

I want to use a shared ImageLayer as a mask for my shaders. I have successfully implemented the example osgearth_sharedlayer in which a shape file is loaded, rasterized and used as a mask. I now want to add and remove shapes at runtime and adjust my mask layer accordingly. I have so far only managed to adjust the shapes in the ModelLayer, but I cannot rasterize them to use in the shared ImageLayer. Do you have any suggestion?

Thanks!