Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix depth fail material in Edge #5359

Merged
merged 3 commits into from
May 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Change Log
* Fixed a crash when morphing from Columbus view to 3D. [#5311](https://github.com/AnalyticalGraphicsInc/cesium/issues/5311)
* Fixed a bug which prevented KML descriptions with relative paths from loading. [#5352](https://github.com/AnalyticalGraphicsInc/cesium/pull/5352)
* 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