Cheaper id-map pass, and buildings that read right from below - #47
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes to how
@glyphcss/mapsdraws a city: one for speed, two for what a building actually looks like when you stand next to it.The id-map pass skips what it can't paint.
computeOcclusionIdsrasterised every polygon in the scene, including the onesPolygon.hiddenhad already culled and the cull runs the paint loop itself skips. A hidden polygon that claims a cell is worse than a wasted cycle — it punches every other layer out of a cell nothing then fills.computeOcclusionIds6.84 → 4.69 ms on a globe overview and 6.95 → 0.68 ms at street level, where 85% of the walls are culled; on/mapswith the probe, 32.23 → 28.51 ms/frame, 31.0 → 35.0 fps.A raised band gets an underside.
glyphMapVectorMeshemitted a cap and walls and no floor, so a band standing off its own ground was a hollow shell from below: the cap is back-face culled, the far walls go with it, and you look straight through. The Berlin Fernsehturm is eight stackedrender_min_heightbands and seven of them were open. A raised band now gets a floor wound opposite its own cap face; a building standing on the ground still gets none, since that floor is buried.A facade is refused on a mast. Window bays are a claim that the wall is a storey stack, and no tile schema can tell us whether it is — the live OpenFreeMap
buildinglayer carries exactlyrender_height,render_min_height,hide_3dandcolour, sobuilding=towernever arrives. The shape separates instead: across three real z14 city tiles every genuine building is at or under 7.8 times taller than its footprint is wide and the first mast is 8.5, soGLYPH_MAP_FACADE_MAX_SLENDERNESSis 8. Houston's towers keep their windows, the Fernsehturm loses its.Reasoning and measurements in
docs/design/maps.mdanddocs/design/performance.md, contracts inAGENTS.md. See the checks on this PR forpnpm testandpnpm build.