Skip to content

Commit

Permalink
Merge pull request #6701 from AnalyticalGraphicsInc/fix-upsampled-cli…
Browse files Browse the repository at this point in the history
…pping

Do not write log depth in vertex shader for upsampled terrain.
  • Loading branch information
Hannah authored Jun 19, 2018
2 parents c76c1fe + 0c4fab3 commit fa0abb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Change Log
* Fixed a bug causing crashes with custom vertex attributes on `Geometry` crossing the IDL. Attributes will be barycentrically interpolated. [#6644](https://github.com/AnalyticalGraphicsInc/cesium/pull/6644)
* Fixed a bug causing Point Cloud tiles with unsigned int batch-ids to not load. [#6666](https://github.com/AnalyticalGraphicsInc/cesium/pull/6666)
* Fixed a bug with Draco encoded i3dm tiles, and loading two Draco models with the same url. [#6668](https://github.com/AnalyticalGraphicsInc/cesium/issues/6668)
* Fixed terrain clipping when the camera was close to flat terrain and was using logarithmic depth. [#6701](https://github.com/AnalyticalGraphicsInc/cesium/pull/6701)

### 1.46.1 - 2018-06-01

Expand Down
12 changes: 10 additions & 2 deletions Source/Scene/GlobeSurfaceShaderSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ define([
quantizationDefine = 'QUANTIZATION_BITS12';
}

var vertexLogDepth = 0;
var vertexLogDepthDefine = '';
if (surfaceTile.terrainData._createdByUpsampling) {
vertexLogDepth = 1;
vertexLogDepthDefine = 'DISABLE_GL_POSITION_LOG_DEPTH';
}

var sceneMode = frameState.mode;
var flags = sceneMode |
(applyBrightness << 2) |
Expand All @@ -93,7 +100,8 @@ define([
(enableFog << 13) |
(quantization << 14) |
(applySplit << 15) |
(enableClippingPlanes << 16);
(enableClippingPlanes << 16) |
(vertexLogDepth << 17);

var currentClippingShaderState = 0;
if (defined(clippingPlanes)) {
Expand Down Expand Up @@ -125,7 +133,7 @@ define([
fs.sources.unshift(getClippingFunction(clippingPlanes, frameState.context)); // Need to go before GlobeFS
}

vs.defines.push(quantizationDefine);
vs.defines.push(quantizationDefine, vertexLogDepthDefine);
fs.defines.push('TEXTURE_UNITS ' + numberOfDayTextures);

if (applyBrightness) {
Expand Down

0 comments on commit fa0abb9

Please sign in to comment.