<FeatureModel name="OSM Buildings" features="data:osm">
    <pickable>false</pickable>
    <node_caching>true</node_caching>
    <max_range>15000</max_range>
    <attenuation_range>2000</attenuation_range>
    <fading duration="1"/>
    <filters>
        <attributes>building</attributes>
    </filters>
    <styles>                 
        <style type="text/css"> <![CDATA[
            common {
                extrusion-height: height();
                extrusion-flatten: true;
                extrusion-roof-style: roof;
                altitude-clamping: terrain;
                extrusion-wall-gradient: 0.5;                
                fill: #ff7f00;
            }
            low : common {
                select: height() < 20.0;
                fill: #ff7f00;
            }
            medium : common {
                select: height() >= 20 && height() < 50;
                fill: #7fff00;
            }
            high : common {
                select: height() >= 50;
                fill: #00ff7f;
            }
            roof {
                fill: #dfdfef;
            }
            ]]>
        </style>
        
        <script> <![CDATA[
            function height() {
                var h = 4.0 + (feature.id % 10);
                if ("height" in feature.properties)
                    h = parseFloat(feature.properties['height'].replace('m',''));
                else if ("building:height" in feature.properties)
                    h = parseFloat(feature.properties["building:height"].replace('m',''));
                else if ("building:levels" in feature.properties)
                    h = parseFloat(feature.properties["building:levels"] * 4.0);
                return Math.max(h, 4.0);
            } ]]>
        </script>
    </styles>
    <shader>
      <![CDATA[
        #version 330
        #pragma vp_function buildings_frag, fragment
        struct OE_PBR { float displacement, roughness, ao, metal; } oe_pbr;
        void buildings_frag(inout vec4 color) {
            oe_pbr.roughness = 0.5;
            oe_pbr.metal = 0.5;
        }
      ]]>
    </shader>
</FeatureModel>