Skip to content

Commit

Permalink
fix(elevation): add a removed line from the elevation shader
Browse files Browse the repository at this point in the history
The minimum z of an elevation layer was no longer respected, and it was
causing visual artefacts.
  • Loading branch information
zarov committed Jul 31, 2019
1 parent 4c56493 commit b9de977
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/layers/JSONLayers/GeoidMNT.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"updateStrategy": {
"type": 0
},
"zmin": -12000,
"source": {
"url": "https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/geoid/geoid/bil/%TILEMATRIX/geoid_%COL_%ROW.bil",
"format": "image/x-bil;bits=32",
Expand Down
1 change: 1 addition & 0 deletions src/Renderer/Shader/Chunk/elevation_pars_vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
float getElevation(vec2 uv, sampler2D texture, vec4 offsetScale, Layer layer) {
uv = uv * offsetScale.zw + offsetScale.xy;
float d = getElevationMode(uv, texture, layer.mode);
if (d < layer.zmin || d > layer.zmax) d = 0.;
return d * layer.scale + layer.bias;
}
#endif

0 comments on commit b9de977

Please sign in to comment.