Skip to content

fill-extrusion-ambient-occlusion-intensity affects fill-z-offset renderingΒ #13633

@andrewharvey

Description

@andrewharvey

mapbox-gl-js version

3.19.1

Browser and version

Chrome 145.0.7632.159

Expected behavior

A fill-extrusion layer with fill-extrusion-ambient-occlusion-intensity > 0 should not alter rendering of a fill layer with a fill-z-offset.

Actual behavior

A fill-extrusion layer with fill-extrusion-ambient-occlusion-intensity: 0 will happily render a fill layer with a fill-z-offset set to the fill-extrusion-height above the extrusion, as shown here:

Image

However changing the fill-extrusion-ambient-occlusion-intensity to > 0 will cause the fill layer to disapear.

Image

Link to the demonstration

No response

Steps to trigger the unexpected behavior

const map = new mapboxgl.Map({
      container: 'map',
      style: 'mapbox://styles/mapbox/light-v11',
      center: [151.2804924, -33.8332455],
      zoom: 20,
      pitch: 45,
      bearing: -20
    });

    map.on('load', () => {
      map.addSource('polygon', {
        'type': 'geojson',
        'data': {
          'type': 'FeatureCollection',
          'features': [
            {
              'type': 'Feature',
              'geometry': {
                'type': 'Polygon',
                'coordinates': [[[151.28049658597178, -33.83313240830963], [151.28049658597178, -33.8332436482681], [151.28062665499317, -33.8332436482681], [151.28062665499317, -33.83313240830963], [151.28049658597178, -33.83313240830963]]]
              },
              'properties': {}
            }
          ]
        }
      });

      map.addLayer({
        'id': 'fill-extrusion',
        'type': 'fill-extrusion',
        'source': 'polygon',
        'paint': {
          'fill-extrusion-color': '#ff0000', //red
          'fill-extrusion-ambient-occlusion-intensity': 1,
          'fill-extrusion-height': 10,
        }
      })

      map.addLayer({
        'id': 'fill',
        'type': 'fill',
        'source': 'polygon',
        'paint': {
          'fill-color': '#0000ff', // blue
          'fill-z-offset': 10,
        }
      })
    })

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions