Allow negative fill-extrusion-base and fill-extrusion-height (#8051) - #8069
Allow negative fill-extrusion-base and fill-extrusion-height (#8051)#8069clement-igonet wants to merge 19 commits into
Conversation
07ec037 to
8777baf
Compare
Remove the ground-level clamp in the fill-extrusion vertex shader so negative values extrude below ground (maplibre#8051). The terrain basement heuristic now applies only to bases exactly at ground level, so intentionally negative bases are not lowered further. The top is kept at or above the base. Needs the corresponding maplibre-style-spec change dropping minimum: 0 from both properties.
8777baf to
c9b99e6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8069 +/- ##
=======================================
Coverage 93.92% 93.92%
=======================================
Files 290 290
Lines 24916 24916
Branches 6575 6575
=======================================
Hits 23402 23402
Misses 1514 1514 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I think the one on the left looks quite buggy. |
|
Can you make the image use something more transparent when the building is underground maybe? |
|
Good point, reworked the visual. The PR only defines the geometry; what the user sees is up to the style, and negative bases make an excavation pattern possible: a ring polygon extruded from 0 down forms the pit walls, open in the middle, with the floors inside (right side; on main everything collapses to ground level). A real hole in the draped ground would need polygon clipping of the basemap, which I think is a separate feature. The ground raster is dimmed in the demo for visibility, and an opaque ground-level cover around the pit occludes the interior at the rim, which is what makes it read as a hole rather than a platform. Live version: https://maplibre.confinia.io/debug/underground-pit-8051.html |
|
Tried your suggestion and it turns out the transparent-ground appearance works purely at the style level: draw the basemap raster, then the underground layer, then the same raster again with raster-opacity around 0.5, then the above-ground layers. Depth ordering makes the semi-transparent ground draw above everything below elevation 0, so underground volumes ghost through it while above-ground buildings stay crisp (right side; left is main). Over normal ground the second raster is invisible, so no masking is needed. Live: https://maplibre.confinia.io/debug/underground-xray-8051.html |
…negative-base-8051 # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ement-igonet/maplibre-gl-js into fix/fill-extrusion-negative-base-8051
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…negative-base-8051 # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…negative-base-8051 # Conflicts: # CHANGELOG.md
…stead of a plain fill Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…negative-base-8051 # Conflicts: # CHANGELOG.md # test/build/bundle_size.json
…negative-base-8051 # Conflicts: # CHANGELOG.md
…negative-base-8051 # Conflicts: # CHANGELOG.md
…-8051' into fix/fill-extrusion-negative-base-8051


Fill-extrusion layers can now extrude below ground level: negative
fill-extrusion-baseandfill-extrusion-heightvalues render underground volumes instead of being clamped to the ground. This enables underground floor levels for indoor mapping, for example the basement levels of a station or a building (#8051).Before / after, an above/below-ground floor stack (levels +2 to -3), left is current main, right is this PR:
Live comparison: https://maplibre.confinia.io/debug/underground-compare-8051.html
Pairs with maplibre/maplibre-style-spec#1794, which lifts the
minimum: 0constraint on both properties.Launch Checklist
CHANGELOG.mdunder the## mainsection.Assisted-By: Claude (claude-fable-5)