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 2 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
6 changes: 0 additions & 6 deletions Source/Scene/Primitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -994,15 +994,11 @@ define([
function depthClampVS(vertexShaderSource) {
var modifiedVS = ShaderSource.replaceMain(vertexShaderSource, 'czm_non_depth_clamp_main');
modifiedVS +=
'#ifdef GL_EXT_frag_depth\n' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an explicit optimization, we usually put the #ifdef everywhere and do not rely, for example, on the GLSL compiler to optimize out unused code.

Perhaps add a comment here that this is used for frag depth, but it is not in an #ifdef to workaround an Edge bug.

Also submit an Edge bug please.

'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 +1008,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