Feature Stencil

This plugin “drapes” vector feature data over the terrain using a stencil buffering technique.

Example usage:

<model driver="feature_stencil">
    <features name="world" driver="ogr">
        <url>../data/world.shp</url>
    </features>

    <styles>
        <style type="text/css">
            world {
               stroke:         #ffff007f;
               stroke-width:   0.1;
            }
        </style>
    </styles>
</model>

Properties:

extrusion_distance

How far to extrude stencil volumes (meters)

inverted

Whether to stencil the inversion of the feature data (true/false)

mask

Whether to use the stenciled region as a terrain mask (true/false)

show_volumes

For debugging; draws the actual stencil volume geometry

Shared properties:

All the feature-rendering drivers share the following properties (in addition to those above):

styles

Stylesheet to use to render features (see: Symbology Reference)

layout

Paged data layout (see: Features & Symbology)

cache_policy

Caching policy (see: Caching)

fading

Fading behavior (see: Fading)

feature_name

Expression evaluating to the attribute name containing the feature name

feature_indexing

Whether to index features for query (default is false)

lighting

Whether to override and set the lighting mode on this layer (t/f)

max_granularity

Anglular threshold at which to subdivide lines on a globe (degrees)

shader_policy

Options for shader generation (see: Shader Policy) :use_texture_arrays: Whether to use texture arrays for wall and roof skins if you’re card supports them. (default is true)

Also see:

feature_stencil_line_draping.earth sample in the repo

Notes:

  • This plugin does NOT support paging (display layouts).


Fading

When fading is supported on a model layer, you can control it like so:

<model ...
    <fading duration  = "1.0"
            max_range = "6000"
            attenuation_distance = "1000" />

Properties:

duration

Time over which to fade in (seconds)

max_range

Distance at which to start the fade-in

attenuation_distance

Distance over which to fade in

Shader Policy

Some drivers support a shader policy that lets you control how (or whether) to generate shaders for external geometry. For example, if you want to load an external model via a stylesheet, but do NOT want osgEarth to generate shaders for it:

<model ...
    <shader_policy>disable</shader_policy>