Skip to content
Closed
Show file tree
Hide file tree
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 Jun 2, 2021
abed684
render more tiles to avoid wholes on tiled maps at canvas bottom
prozessor13 Jun 2, 2021
5f77f5c
Proof of concept! to get mercator-coords from the 3d-mesh on screen.
prozessor13 Jun 2, 2021
6f3278c
fix bug in picking correct coords from coordsFramebuffer
prozessor13 Jun 4, 2021
341ef2f
Add Depthbuffer to RTT Framebuffer
prozessor13 Jun 4, 2021
2a2a35d
add z-dimension to circle layers
prozessor13 Jun 16, 2021
71fa7a5
switch to regular grid, correct rendering below ZL14, remove visible …
prozessor13 Jun 18, 2021
2ae33e3
fix raster-rendering, hacky performance improvement
prozessor13 Jun 21, 2021
ebf5ea4
add z-dimension to fill-extrusion
prozessor13 Jun 22, 2021
bdf3eea
fix regular grid
prozessor13 Jun 23, 2021
129bda2
hide symbols behind terrain
prozessor13 Jun 25, 2021
ac2f0ee
calculate elevation of symbol/circle/extrusion only once
prozessor13 Jun 29, 2021
5c21371
render coords-framebuffer only on camera movement
prozessor13 Jun 29, 2021
9e4c74e
improve performacne: render layers to texture only once
prozessor13 Jul 2, 2021
2a3f99a
* raise camera to correct zoomlevel-distance over terrain
prozessor13 Jul 14, 2021
9af3979
Merge branch 'maplibre:main' into terrain3d
prozessor13 Jul 14, 2021
d95a197
Add an elevation offset of 450m to put the dead sea into positive values
prozessor13 Jul 14, 2021
0ff2e33
add yarn.lock file with martini entries
prozessor13 Jul 14, 2021
fe3b92a
render tiles only if terrain is loaded
prozessor13 Jul 26, 2021
5d24943
reuse framebuffer objects during rtt rendering
prozessor13 Jul 26, 2021
7aaff8f
reuse regular-mesh in all tiles
prozessor13 Jul 26, 2021
87e8205
add transform.elevation
prozessor13 Jul 27, 2021
ba9bd36
create transform.invProjMatrix before elevation correcture
prozessor13 Jul 28, 2021
55ad06a
* move exaggeration calculation into shaders
prozessor13 Aug 10, 2021
9f7edd4
convert to ts, but do not test this, it still has issues
prozessor13 Sep 6, 2021
1875f51
some minor fixes, add map.addTerrain and map.removeTerrain
prozessor13 Sep 10, 2021
7c6903a
refactor texture rendering
prozessor13 Sep 14, 2021
35a5e1b
moved elevation-calculation to GPU
prozessor13 Sep 24, 2021
7ecbc8a
fix calculate_visibility in overzoomed terrain-tiles
prozessor13 Sep 28, 2021
398c5a5
Merge branch 'main' into terrain3d
prozessor13 Sep 28, 2021
6b395d1
add very basic logic of loading tiles in respect of their elevation
prozessor13 Sep 29, 2021
7df734d
correct unprojecting coordinates
prozessor13 Oct 5, 2021
e644791
correct calculation of elevation in CPU for different maxzoom settings
prozessor13 Oct 6, 2021
1b36830
calcuate symbol visibility via a depth-framebuffer, because the coord…
prozessor13 Oct 7, 2021
cd34a3a
fix symbol flickering
prozessor13 Oct 7, 2021
b838fcd
typo
prozessor13 Oct 7, 2021
3d75e2f
move symbol/circle/fill_extrusion height calculation to GPU
prozessor13 Oct 15, 2021
10c7332
bugfix when rerender tiles, closes #24
prozessor13 Oct 19, 2021
11a133b
* free GPU less aggressive
prozessor13 Oct 21, 2021
f819944
bugfix with TerrainSourceCache.deltaZoom
prozessor13 Nov 3, 2021
eb595ce
* bugfix in u_terrain_matrix
prozessor13 Nov 3, 2021
e8fad6e
add linear interpolation
prozessor13 Nov 5, 2021
e41daac
remove visible tile-boundaries
prozessor13 Nov 5, 2021
68cad1e
reimplement deltaZoom
prozessor13 Nov 5, 2021
fa57d70
fix marker wobbling & check visibility
prozessor13 Nov 5, 2021
0535ad0
Merge branch 'main' into terrain3d
prozessor13 Nov 8, 2021
939a924
some code cleanup
prozessor13 Nov 9, 2021
86b7dbd
...
prozessor13 Nov 9, 2021
4efafc0
use preloaded terraintiles when zooming in and out
prozessor13 Nov 10, 2021
6e8beab
...
prozessor13 Nov 10, 2021
4b76529
bugfix for empty render-to-texture stack
prozessor13 Nov 10, 2021
9f02eba
set LOD tile-loading in case of terrain3d
prozessor13 Nov 12, 2021
b490d1a
avoid double-rendering (because of fading logic) of raster tiles
prozessor13 Nov 17, 2021
be076a6
calculate_visibility now checks visibility also some pixels above
prozessor13 Nov 19, 2021
ab0d337
...
prozessor13 Nov 19, 2021
4c4ff8f
add code-documentation
prozessor13 Nov 25, 2021
7d5d217
remove mtk raster-dem tiles hack
prozessor13 Nov 25, 2021
bc2ec6a
add more minor fixes and add some comments
prozessor13 Nov 26, 2021
53865a8
bugfix for collision-index calculation with disabled 3d,
prozessor13 Nov 26, 2021
b508431
Merge branch 'main' into terrain3d
prozessor13 Nov 26, 2021
2299f30
revert old fill_extrusion_bucket centroid code,
prozessor13 Nov 26, 2021
98137d3
fixes #36
prozessor13 Nov 29, 2021
0b81a41
Update CHANGELOG.md
acalcutt Dec 6, 2021
2192c1d
Revert "Update CHANGELOG.md"
acalcutt-wsu Dec 6, 2021
2031d8e
attribution fixes (from astridx)
acalcutt-wsu Dec 6, 2021
032b16e
Update .gitignore
acalcutt Dec 7, 2021
711436a
fix missing new line lint complained about
acalcutt Dec 7, 2021
41be4b5
Merge branch 'maplibre:main' into main
acalcutt Dec 8, 2021
629e818
Merge branch 'maplibre:main' into main
acalcutt Dec 9, 2021
7895d04
first try (not finished) to leave the camera at the same height when …
prozessor13 Dec 9, 2021
c68a94c
Merge branch 'maplibre:main' into main
acalcutt Dec 11, 2021
53d97eb
Revert "attribution fixes (from astridx)"
acalcutt Dec 11, 2021
5a28802
Merge remote-tracking branch 'prozessor13/terrain3d' into terrain_but…
acalcutt Dec 17, 2021
466f964
Create a TerrainControl to toggle terrain
acalcutt Dec 17, 2021
c1b695d
fix tabs and comment
acalcutt Dec 17, 2021
46bed6a
Merge branch 'maplibre:main' into main
acalcutt Dec 17, 2021
f967ea8
change exaggeration type to number. add options to control example
acalcutt Dec 19, 2021
b263230
change terrain icon fill color when enabled
acalcutt Dec 19, 2021
24af518
Merge branch 'maplibre:main' into main
acalcutt Dec 21, 2021
8f9d5e7
Merge branch 'maplibre:main' into main
acalcutt Dec 23, 2021
f6ac710
Merge branch 'main' into terrain3d
prozessor13 Dec 23, 2021
dcb1f88
Merge branch 'main' into terrain_button_test
acalcutt Dec 26, 2021
c414948
Merge remote-tracking branch 'terrain/terrain3d' into terrain_button_…
acalcutt Dec 26, 2021
8ab66b0
revert some merge changes
acalcutt Dec 26, 2021
be5e0e9
Revert package-lock.json for pull request
acalcutt Dec 26, 2021
d4f75f4
Merge branch 'main' into terrain3d
prozessor13 Jan 13, 2022
a27c387
some improvements leave the camera in the same height during paning
prozessor13 Jan 13, 2022
4e5f5a8
set default pitch back to 65, because of too much labels & missing sky
prozessor13 Jan 13, 2022
b2a730b
fix "mismatched image size" errors in some of our stylesheets
prozessor13 Jan 14, 2022
72cea62
Merge branch 'maplibre:main' into main
prozessor13 Jan 14, 2022
cfcba57
Merge branch 'main' into terrain3d
prozessor13 Jan 14, 2022
136b7d4
add default values during tinySDF generation
prozessor13 Jan 14, 2022
d8b7dcf
Merge pull request #51 from acalcutt/terrain_button_test
prozessor13 Jan 19, 2022
7cf9085
fire "terrain" events
prozessor13 Jan 19, 2022
94734ca
let use TerrainControl use terrain-Event
prozessor13 Jan 19, 2022
2fc3a57
typo
prozessor13 Jan 20, 2022
ffc30c9
may fix farZ clippingplane calculation
prozessor13 Jan 20, 2022
26a325a
fix TileID-order of transform.coveringTiles result
prozessor13 Jan 20, 2022
0ca7148
call transform.updateElevation on every rendering
prozessor13 Jan 20, 2022
c5ef800
rerender rtt tiles on geojson.setData
prozessor13 Feb 8, 2022
e1c00c7
freezeElevation while camera-easing
prozessor13 Feb 8, 2022
1298a76
Merge branch 'maplibre:main' into main
prozessor13 Feb 8, 2022
12e091a
Merge branch 'main' into terrain3d
prozessor13 Feb 8, 2022
84674ef
make tests running
prozessor13 Feb 10, 2022
b924457
speedup symbol-placement in 2D mode
prozessor13 Feb 15, 2022
daaf8ca
...
prozessor13 Feb 15, 2022
32b01dd
add first very poor TerrainSourceCache test
prozessor13 Feb 16, 2022
f146f67
...
prozessor13 Feb 16, 2022
3343d35
show correct tileBoundaries & collisionBoxes in terrain
prozessor13 Feb 17, 2022
87601e2
load LOD tiles in respect of terrain
prozessor13 Feb 17, 2022
2439a60
rename getElevationWithExaggeration to getElevation
prozessor13 Feb 17, 2022
a2246ba
calculate tileDistanceToCamera form future-use in tile reduction algo…
prozessor13 Feb 21, 2022
0aea4c6
update terrain-test page to maxPitch = 85
prozessor13 Feb 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions debug/terrain.html
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
});
Comment thread
prozessor13 marked this conversation as resolved.

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>
52 changes: 52 additions & 0 deletions debug/terrain_control.html
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>
Loading