Skip to content

Commit 64f7556

Browse files
stephanheiglgithub-actions[bot]
authored andcommitted
Fix render cut off for elevated raster-layer rendering in ortho
projection range. GitOrigin-RevId: e7534dfb5084753e44bc24a5868ebc231618af2f
1 parent 0b3eb3f commit 64f7556

File tree

5 files changed

+122
-0
lines changed

5 files changed

+122
-0
lines changed

src/render/draw_raster.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ function drawPole(isNorth: boolean, coord: OverscaledTileID | null | undefined,
407407

408408
// Configure a fade out effect for elevated raster layers when they're close to the camera
409409
function cutoffParamsForElevation(tr: Transform): [number, number, number, number] {
410+
if (tr.isOrthographic) {
411+
return [0, 0, 0, 0];
412+
}
410413
const near = tr._nearZ;
411414
const far = tr.projection.farthestPixelDistance(tr);
412415
const zRange = far - near;
394 KB
Loading
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"width": 512,
6+
"height": 512,
7+
"allowed": 0.0029
8+
}
9+
},
10+
"zoom": 5.9999,
11+
"center": [-95, 39],
12+
"pitch": 60,
13+
"projection": {
14+
"name": "globe"
15+
},
16+
"fog": {
17+
"star-intensity": 0
18+
},
19+
"camera": {
20+
"camera-projection": "perspective"
21+
},
22+
"sources": {
23+
"mapbox": {
24+
"type": "vector",
25+
"maxzoom": 14,
26+
"tiles": [
27+
"local://tiles/{z}-{x}-{y}.mvt"
28+
]
29+
},
30+
"image": {
31+
"type": "raster",
32+
"tiles": [
33+
"local://tiles/1-1-0.satellite.png"
34+
],
35+
"maxzoom": 17,
36+
"tileSize": 256
37+
}
38+
},
39+
"transition": {
40+
"duration": 0
41+
},
42+
"layers": [
43+
{
44+
"id": "background",
45+
"type": "background",
46+
"paint": {
47+
"background-color": "red"
48+
}
49+
},
50+
{
51+
"id": "image",
52+
"type": "raster",
53+
"source": "image",
54+
"paint": {
55+
"raster-fade-duration": 0,
56+
"raster-opacity": 0.5,
57+
"raster-elevation": 10000.0
58+
}
59+
}
60+
]
61+
}
224 KB
Loading
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"width": 512,
6+
"height": 512,
7+
"allowed": 0.001
8+
}
9+
},
10+
"zoom": 8,
11+
"center": [-95, 39],
12+
"pitch": 0,
13+
"fog": {
14+
"star-intensity": 0
15+
},
16+
"camera": {
17+
"camera-projection": "orthographic"
18+
},
19+
"sources": {
20+
"mapbox": {
21+
"type": "vector",
22+
"maxzoom": 14,
23+
"tiles": [
24+
"local://tiles/{z}-{x}-{y}.mvt"
25+
]
26+
},
27+
"image": {
28+
"type": "raster",
29+
"tiles": [
30+
"local://tiles/1-1-0.satellite.png"
31+
],
32+
"maxzoom": 17,
33+
"tileSize": 256
34+
}
35+
},
36+
"transition": {
37+
"duration": 0
38+
},
39+
"layers": [
40+
{
41+
"id": "background",
42+
"type": "background",
43+
"paint": {
44+
"background-color": "red"
45+
}
46+
},
47+
{
48+
"id": "image",
49+
"type": "raster",
50+
"source": "image",
51+
"paint": {
52+
"raster-fade-duration": 0,
53+
"raster-opacity": 0.5,
54+
"raster-elevation": 10000.0
55+
}
56+
}
57+
]
58+
}

0 commit comments

Comments
 (0)