When building a raster layer, you can provide hints about the interaction expected between the application user and the layer.

You can assign a layer type to LuciadCPillar raster layers according to the expected level of interaction:

This code snippet demonstrates how you can set the raster layer typetypetype at build time:

Program: Setting the type of the raster layer
auto rasterLayer = RasterLayer::newBuilder().model(rasterModel).layerType(RasterLayerType::Interactive).build();
RasterLayer layer = RasterLayer.NewBuilder().Model(rasterModel).LayerType(RasterLayerType.Interactive).Build();
RasterLayer layer = RasterLayer.newBuilder().model(rasterModel).layerType(RasterLayerType.Interactive).build();

If you build a raster layer without specifying its type, LuciadCPillar treats it as a BackgroundBackgroundBackground layer by default.

Setting the raster layer typetypetype only affects imagery raster layers. It has no effect on elevation raster layers.

Background layer features

By setting a raster layer as a BackgroundBackgroundBackground layer, you indicate that it contains static data which is rarely or never modified. This setting causes LuciadCPillar to perform certain optimizations, such as better RAM and GPU memory management and better CPU load sharing between the render thread and background threads. However, changes to a background layer’s visibility, its position in the view’s layer hierarchy, or its styling may lead to a significant performance cost.

Setting a raster layer as a BackgroundBackgroundBackground layer also affects the default layer ordering: if you add a BackgroundBackgroundBackground layer to the layer list without specifying its position, LuciadCPillar goes through the layer list starting from the top, and places it just above the first BackgroundBackgroundBackground layer it encounters. Therefore, BackgroundBackgroundBackground layers typically have a position near the bottom of the layer list.

BackgroundBackgroundBackground layers are treated as such as long as there are no InteractiveInteractiveInteractive layers or non-raster layers below them in the layer list. Otherwise, BackgroundBackgroundBackground layers are treated as if they were InteractiveInteractiveInteractive layers.

BackgroundBackgroundBackground raster layers with text images may appear partially blurred compared with their InteractiveInteractiveInteractive counterparts. If this happens, we recommend that you set the raster layer type as InteractiveInteractiveInteractive.

Interactive layer features

By setting a raster layer as InteractiveInteractiveInteractive, you indicate that the layer visualization algorithm must optimize its performance for interactive layer manipulation by the user. Examples of such interactive layer manipulations are layer visibility changes, or layer stylesstylesstyles changes through interactive UI controls.

Keep in mind that GPU memory consumption and computational load on the render thread increase as the number of InteractiveInteractiveInteractive layers in the layer list increases.