Skip to content

Commit

Permalink
Merge pull request #5359 from AnalyticalGraphicsInc/ie-workaround
Browse files Browse the repository at this point in the history
Fix depth fail material in Edge
  • Loading branch information
pjcozzi authored May 24, 2017
2 parents b6e2d0d + 26d0d6f commit 97751cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Change Log
* Fixed a bug which prevented KML descriptions with relative paths from loading. [#5352](https://github.com/AnalyticalGraphicsInc/cesium/pull/5352)
* Fixed an issue where camera view could be invalid at the last frame of animation. [#4949](https://github.com/AnalyticalGraphicsInc/cesium/issues/4949)
* Updated documentation for Quaternion.fromHeadingPitchRoll [#5264](https://github.com/AnalyticalGraphicsInc/cesium/issues/5264)
* Fixed an issue where using the depth fail material for polylines would cause a crash in Edge. [#5359](https://github.com/AnalyticalGraphicsInc/cesium/pull/5359)

### 1.33 - 2017-05-01

Expand Down
9 changes: 3 additions & 6 deletions Source/Scene/Primitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,16 +993,15 @@ define([

function depthClampVS(vertexShaderSource) {
var modifiedVS = ShaderSource.replaceMain(vertexShaderSource, 'czm_non_depth_clamp_main');
// The varying should be surround by #ifdef GL_EXT_frag_depth as an optimization.
// It is not to workaround an issue with Edge:
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12120362/
modifiedVS +=
'#ifdef GL_EXT_frag_depth\n' +
'varying float v_WindowZ;\n' +
'#endif\n' +
'void main() {\n' +
' czm_non_depth_clamp_main();\n' +
' vec4 position = gl_Position;\n' +
'#ifdef GL_EXT_frag_depth\n' +
' v_WindowZ = (0.5 * (position.z / position.w) + 0.5) * position.w;\n' +
'#endif\n' +
' position.z = min(position.z, position.w);\n' +
' gl_Position = position;' +
'}\n';
Expand All @@ -1012,9 +1011,7 @@ define([
function depthClampFS(fragmentShaderSource) {
var modifiedFS = ShaderSource.replaceMain(fragmentShaderSource, 'czm_non_depth_clamp_main');
modifiedFS +=
'#ifdef GL_EXT_frag_depth\n' +
'varying float v_WindowZ;\n' +
'#endif\n' +
'void main() {\n' +
' czm_non_depth_clamp_main();\n' +
'#ifdef GL_EXT_frag_depth\n' +
Expand Down

0 comments on commit 97751cc

Please sign in to comment.