-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problems with models and depth precision in ortho camera (interna…
…l-2152) This PR fixes two problems with ortho projection, one when models are close to the camera and the precision was being lost, and the other when using transparent models being culled, (mostly visible with terrain enabled).
- Loading branch information
1 parent
f5f4b1d
commit 9f9249b
Showing
6 changed files
with
463 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Binary file added
BIN
+29.4 KB
...el-layer/camera-projection/camera-orthographic-model-depth-terrain/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
233 changes: 233 additions & 0 deletions
233
...er-tests/model-layer/camera-projection/camera-orthographic-model-depth-terrain/style.json
This file contains 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,233 @@ | ||
{ | ||
"version": 8, | ||
"metadata": { | ||
"test": { | ||
"operations": [ | ||
[ | ||
"wait", | ||
600 | ||
] | ||
], | ||
"width": 512, | ||
"height": 512, | ||
"allowed": 0.0008 | ||
} | ||
}, | ||
"terrain": { | ||
"source": "mapbox-dem", | ||
"exaggeration": 1 | ||
}, | ||
"lights": [ | ||
{ | ||
"type": "ambient", | ||
"id": "environment", | ||
"properties": { | ||
"color": "rgba(255.0, 255.0, 255.0, 1.0)", | ||
"intensity": 0.5 | ||
} | ||
}, | ||
{ | ||
"type": "directional", | ||
"id": "sun_light", | ||
"properties": { | ||
"color": "rgba(255.0, 255.0, 255.0, 1.0)", | ||
"intensity": 0.5, | ||
"cast-shadows": false | ||
} | ||
} | ||
], | ||
"sources": { | ||
"mapbox-dem": { | ||
"type": "raster-dem", | ||
"maxzoom": 14, | ||
"tileSize": 512, | ||
"tiles": ["local://models/dem/14-8847-5550.terrain-512.png"] | ||
}, | ||
"mapbox": { | ||
"type": "vector", | ||
"maxzoom": 16, | ||
"tiles": [ | ||
"local://tiles/{z}-{x}-{y}.mvt" | ||
] | ||
}, | ||
"model": { | ||
"type": "model", | ||
"models": { | ||
"model-1" : { | ||
"uri": "local://models/cubes-depth.gltf", | ||
"position": [14.3946, 50.0834], | ||
"orientation": [0, 0, 0] | ||
} | ||
} | ||
} | ||
}, | ||
"pitch": 0, | ||
"zoom": 18.0, | ||
"bearing": 0, | ||
"center": [ | ||
14.3946, | ||
50.0834 | ||
], | ||
"camera": { | ||
"camera-projection": "orthographic" | ||
}, | ||
"glyphs": "local://glyphs/{fontstack}/{range}.pbf", | ||
"layers": [ | ||
{ | ||
"id": "background", | ||
"type": "background", | ||
"paint": { | ||
"background-color": "lightgray" | ||
} | ||
}, | ||
{ | ||
"id": "land", | ||
"type": "fill", | ||
"source": "mapbox", | ||
"source-layer": "water", | ||
"paint": { | ||
"fill-color": "lightblue" | ||
} | ||
}, | ||
{ | ||
"id": "road", | ||
"type": "line", | ||
"source": "mapbox", | ||
"source-layer": "road", | ||
"paint": { | ||
"line-color": "lightyellow", | ||
"line-width": 10 | ||
} | ||
}, | ||
{ | ||
"id": "extrusion", | ||
"type": "fill-extrusion", | ||
"source": "mapbox", | ||
"source-layer": "building", | ||
"paint": { | ||
"fill-extrusion-color": "white", | ||
"fill-extrusion-height": ["get", "height"] | ||
} | ||
}, | ||
{ | ||
"filter": [ | ||
"match", | ||
[ | ||
"get", | ||
"class" | ||
], | ||
[ | ||
"motorway", | ||
"primary", | ||
"secondary", | ||
"street", | ||
"street_limited", | ||
"tertiary", | ||
"trunk" | ||
], | ||
true, | ||
false | ||
], | ||
"id": "road-label-simple", | ||
"layout": { | ||
"symbol-placement": "line", | ||
"text-field": [ | ||
"format", | ||
[ | ||
"coalesce", | ||
[ | ||
"get", | ||
"name_en" | ||
], | ||
[ | ||
"get", | ||
"name" | ||
] | ||
], | ||
{} | ||
], | ||
"text-font": [ | ||
"Open Sans Semibold", | ||
"Arial Unicode MS Bold" | ||
], | ||
"text-letter-spacing": 0.009999999776482582, | ||
"text-max-angle": 30.0, | ||
"text-padding": 1.0, | ||
"text-pitch-alignment": "viewport", | ||
"text-rotation-alignment": "map", | ||
"text-size": [ | ||
"interpolate", | ||
[ | ||
"linear" | ||
], | ||
[ | ||
"zoom" | ||
], | ||
10.0, | ||
[ | ||
"match", | ||
[ | ||
"get", | ||
"class" | ||
], | ||
[ | ||
"motorway", | ||
"primary", | ||
"secondary", | ||
"tertiary", | ||
"trunk" | ||
], | ||
10.0, | ||
9.0 | ||
], | ||
18.0, | ||
[ | ||
"match", | ||
[ | ||
"get", | ||
"class" | ||
], | ||
[ | ||
"motorway", | ||
"primary", | ||
"secondary", | ||
"tertiary", | ||
"trunk" | ||
], | ||
16.0, | ||
14.0 | ||
] | ||
] | ||
}, | ||
"minzoom": 12.0, | ||
"paint": { | ||
"text-color": [ | ||
"rgba", | ||
154.0, | ||
121.00000762939453, | ||
55.000003814697269, | ||
1.0 | ||
], | ||
"text-halo-color": [ | ||
"rgba", | ||
255.0, | ||
255.0, | ||
255.0, | ||
1.0 | ||
], | ||
"text-halo-width": 1.0 | ||
}, | ||
"source": "mapbox", | ||
"source-layer": "road", | ||
"type": "symbol" | ||
}, | ||
{ | ||
"id": "model", | ||
"type": "model", | ||
"source": "model", | ||
"paint" : { | ||
"model-scale" : [4, 4, 4] | ||
} | ||
} | ||
] | ||
} |
Binary file added
BIN
+20.8 KB
...ests/model-layer/camera-projection/camera-orthographic-model-depth/expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.