-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Terrain 3D #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Terrain 3D #165
Changes from all commits
Commits
Show all changes
113 commits
Select commit
Hold shift + click to select a range
2c7f8c9
A working prototype, which adds 3d-terrain to maplibre-gl. Sadly, dur…
prozessor13 abed684
render more tiles to avoid wholes on tiled maps at canvas bottom
prozessor13 5f77f5c
Proof of concept! to get mercator-coords from the 3d-mesh on screen.
prozessor13 6f3278c
fix bug in picking correct coords from coordsFramebuffer
prozessor13 341ef2f
Add Depthbuffer to RTT Framebuffer
prozessor13 2a2a35d
add z-dimension to circle layers
prozessor13 71fa7a5
switch to regular grid, correct rendering below ZL14, remove visible …
prozessor13 2ae33e3
fix raster-rendering, hacky performance improvement
prozessor13 ebf5ea4
add z-dimension to fill-extrusion
prozessor13 bdf3eea
fix regular grid
prozessor13 129bda2
hide symbols behind terrain
prozessor13 ac2f0ee
calculate elevation of symbol/circle/extrusion only once
prozessor13 5c21371
render coords-framebuffer only on camera movement
prozessor13 9e4c74e
improve performacne: render layers to texture only once
prozessor13 2a3f99a
* raise camera to correct zoomlevel-distance over terrain
prozessor13 9af3979
Merge branch 'maplibre:main' into terrain3d
prozessor13 d95a197
Add an elevation offset of 450m to put the dead sea into positive values
prozessor13 0ff2e33
add yarn.lock file with martini entries
prozessor13 fe3b92a
render tiles only if terrain is loaded
prozessor13 5d24943
reuse framebuffer objects during rtt rendering
prozessor13 7aaff8f
reuse regular-mesh in all tiles
prozessor13 87e8205
add transform.elevation
prozessor13 ba9bd36
create transform.invProjMatrix before elevation correcture
prozessor13 55ad06a
* move exaggeration calculation into shaders
prozessor13 9f7edd4
convert to ts, but do not test this, it still has issues
prozessor13 1875f51
some minor fixes, add map.addTerrain and map.removeTerrain
prozessor13 7c6903a
refactor texture rendering
prozessor13 35a5e1b
moved elevation-calculation to GPU
prozessor13 7ecbc8a
fix calculate_visibility in overzoomed terrain-tiles
prozessor13 398c5a5
Merge branch 'main' into terrain3d
prozessor13 6b395d1
add very basic logic of loading tiles in respect of their elevation
prozessor13 7df734d
correct unprojecting coordinates
prozessor13 e644791
correct calculation of elevation in CPU for different maxzoom settings
prozessor13 1b36830
calcuate symbol visibility via a depth-framebuffer, because the coord…
prozessor13 cd34a3a
fix symbol flickering
prozessor13 b838fcd
typo
prozessor13 3d75e2f
move symbol/circle/fill_extrusion height calculation to GPU
prozessor13 10c7332
bugfix when rerender tiles, closes #24
prozessor13 11a133b
* free GPU less aggressive
prozessor13 f819944
bugfix with TerrainSourceCache.deltaZoom
prozessor13 eb595ce
* bugfix in u_terrain_matrix
prozessor13 e8fad6e
add linear interpolation
prozessor13 e41daac
remove visible tile-boundaries
prozessor13 68cad1e
reimplement deltaZoom
prozessor13 fa57d70
fix marker wobbling & check visibility
prozessor13 0535ad0
Merge branch 'main' into terrain3d
prozessor13 939a924
some code cleanup
prozessor13 86b7dbd
...
prozessor13 4efafc0
use preloaded terraintiles when zooming in and out
prozessor13 6e8beab
...
prozessor13 4b76529
bugfix for empty render-to-texture stack
prozessor13 9f02eba
set LOD tile-loading in case of terrain3d
prozessor13 b490d1a
avoid double-rendering (because of fading logic) of raster tiles
prozessor13 be076a6
calculate_visibility now checks visibility also some pixels above
prozessor13 ab0d337
...
prozessor13 4c4ff8f
add code-documentation
prozessor13 7d5d217
remove mtk raster-dem tiles hack
prozessor13 bc2ec6a
add more minor fixes and add some comments
prozessor13 53865a8
bugfix for collision-index calculation with disabled 3d,
prozessor13 b508431
Merge branch 'main' into terrain3d
prozessor13 2299f30
revert old fill_extrusion_bucket centroid code,
prozessor13 98137d3
fixes #36
prozessor13 0b81a41
Update CHANGELOG.md
acalcutt 2192c1d
Revert "Update CHANGELOG.md"
acalcutt-wsu 2031d8e
attribution fixes (from astridx)
acalcutt-wsu 032b16e
Update .gitignore
acalcutt 711436a
fix missing new line lint complained about
acalcutt 41be4b5
Merge branch 'maplibre:main' into main
acalcutt 629e818
Merge branch 'maplibre:main' into main
acalcutt 7895d04
first try (not finished) to leave the camera at the same height when …
prozessor13 c68a94c
Merge branch 'maplibre:main' into main
acalcutt 53d97eb
Revert "attribution fixes (from astridx)"
acalcutt 5a28802
Merge remote-tracking branch 'prozessor13/terrain3d' into terrain_but…
acalcutt 466f964
Create a TerrainControl to toggle terrain
acalcutt c1b695d
fix tabs and comment
acalcutt 46bed6a
Merge branch 'maplibre:main' into main
acalcutt f967ea8
change exaggeration type to number. add options to control example
acalcutt b263230
change terrain icon fill color when enabled
acalcutt 24af518
Merge branch 'maplibre:main' into main
acalcutt 8f9d5e7
Merge branch 'maplibre:main' into main
acalcutt f6ac710
Merge branch 'main' into terrain3d
prozessor13 dcb1f88
Merge branch 'main' into terrain_button_test
acalcutt c414948
Merge remote-tracking branch 'terrain/terrain3d' into terrain_button_…
acalcutt 8ab66b0
revert some merge changes
acalcutt be5e0e9
Revert package-lock.json for pull request
acalcutt d4f75f4
Merge branch 'main' into terrain3d
prozessor13 a27c387
some improvements leave the camera in the same height during paning
prozessor13 4e5f5a8
set default pitch back to 65, because of too much labels & missing sky
prozessor13 b2a730b
fix "mismatched image size" errors in some of our stylesheets
prozessor13 72cea62
Merge branch 'maplibre:main' into main
prozessor13 cfcba57
Merge branch 'main' into terrain3d
prozessor13 136b7d4
add default values during tinySDF generation
prozessor13 d8b7dcf
Merge pull request #51 from acalcutt/terrain_button_test
prozessor13 7cf9085
fire "terrain" events
prozessor13 94734ca
let use TerrainControl use terrain-Event
prozessor13 2fc3a57
typo
prozessor13 ffc30c9
may fix farZ clippingplane calculation
prozessor13 26a325a
fix TileID-order of transform.coveringTiles result
prozessor13 0ca7148
call transform.updateElevation on every rendering
prozessor13 c5ef800
rerender rtt tiles on geojson.setData
prozessor13 e1c00c7
freezeElevation while camera-easing
prozessor13 1298a76
Merge branch 'maplibre:main' into main
prozessor13 12e091a
Merge branch 'main' into terrain3d
prozessor13 84674ef
make tests running
prozessor13 b924457
speedup symbol-placement in 2D mode
prozessor13 daaf8ca
...
prozessor13 32b01dd
add first very poor TerrainSourceCache test
prozessor13 f146f67
...
prozessor13 3343d35
show correct tileBoundaries & collisionBoxes in terrain
prozessor13 87601e2
load LOD tiles in respect of terrain
prozessor13 2439a60
rename getElevationWithExaggeration to getElevation
prozessor13 a2246ba
calculate tileDistanceToCamera form future-use in tile reduction algo…
prozessor13 0aea4c6
update terrain-test page to maxPitch = 85
prozessor13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>MapLibre GL JS debug page</title> | ||
| <meta charset='utf-8'> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | ||
| <link rel='stylesheet' href='../dist/maplibre-gl.css' /> | ||
| <style> | ||
| body { margin: 0; padding: 0; } | ||
| html, body, #map { height: 100%; } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div id='map'></div> | ||
|
|
||
| <script src='../dist/maplibre-gl-dev.js'></script> | ||
| <script src='../debug/access_token_generated.js'></script> | ||
| <script> | ||
|
|
||
| var map = window.map = new maplibregl.Map({ | ||
| container: 'map', | ||
| zoom: 12.5, | ||
| center: [11.40416, 47.26475], | ||
| hash: true, | ||
| style: 'https://static.maptoolkit.net/styles/toursprung/terrain.json', | ||
| maxZoom: 18, | ||
| maxPitch: 85 | ||
| }); | ||
|
|
||
| map.on('load', () => { | ||
| map.addSource('terrain', { | ||
| 'type': 'raster-dem', | ||
| 'tiles': ['https://vtc-cdn.maptoolkit.net/terrainrgb/{z}/{x}/{y}.webp'], | ||
| 'encoding': 'mapbox', | ||
| 'maxzoom': 14, | ||
| 'minzoom': 4 | ||
| }); | ||
| map.addTerrain('terrain', {exaggeration: 0.33}); | ||
| }); | ||
|
|
||
| map.on('click', e => { | ||
| new maplibregl.Marker().setLngLat(e.lngLat).addTo(map); | ||
| }); | ||
|
|
||
| map.addControl(new maplibregl.NavigationControl()); | ||
|
|
||
| </script> | ||
| </body> | ||
| </html> | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>MapLibre GL JS debug page</title> | ||
| <meta charset='utf-8'> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | ||
| <link rel='stylesheet' href='../dist/maplibre-gl.css' /> | ||
| <style> | ||
| body { margin: 0; padding: 0; } | ||
| html, body, #map { height: 100%; } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div id='map'></div> | ||
|
|
||
| <script src='../dist/maplibre-gl-dev.js'></script> | ||
| <link href='../dist/maplibre-gl.css' rel='stylesheet' /> | ||
| <script> | ||
|
|
||
| var map = window.map = new maplibregl.Map({ | ||
| container: 'map', | ||
| zoom: 12.5, | ||
| center: [11.40416, 47.26475], | ||
| hash: true, | ||
| style: 'https://static.maptoolkit.net/styles/toursprung/terrain.json', | ||
| maxZoom: 16 | ||
| }); | ||
|
|
||
| map.on('load', () => { | ||
| map.addSource('terrain', { | ||
| 'type': 'raster-dem', | ||
| 'tiles': ['https://vtc-cdn.maptoolkit.net/terrainrgb/{z}/{x}/{y}.webp'], | ||
| 'encoding': 'mapbox', | ||
| 'maxzoom': 14 | ||
| }); | ||
| map.addControl( | ||
| new maplibregl.TerrainControl({ | ||
| id: 'terrain', | ||
| options: {exaggeration: 0.33} | ||
| }) | ||
| ); | ||
| }); | ||
|
|
||
| map.addControl(new maplibregl.NavigationControl({ | ||
| visualizePitch: true, | ||
| showZoom: true, | ||
| showCompass: true | ||
| })); | ||
| </script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.