Skip to content

Commit

Permalink
Merge pull request #6751 from AnalyticalGraphicsInc/clampDepthFarPlane
Browse files Browse the repository at this point in the history
clamp to far plane for polyline on terrain volumes
  • Loading branch information
bagnell authored Jun 28, 2018
2 parents f5e1a7d + 8997f2f commit d3cc317
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Source/Shaders/PolylineShadowVolumeFS.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#ifdef GL_EXT_frag_depth
#extension GL_EXT_frag_depth : enable
#endif

varying vec4 v_startPlaneNormalEcAndHalfWidth;
varying vec4 v_endPlaneNormalEcAndBatchId;
varying vec4 v_rightPlaneEC; // Technically can compute distance for this here
Expand Down Expand Up @@ -78,4 +82,6 @@ void main(void)
czm_material material = czm_getMaterial(materialInput);
gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR

czm_writeDepthClampedToFarPlane();
}
2 changes: 1 addition & 1 deletion Source/Shaders/PolylineShadowVolumeVS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void main()
#endif

positionEC.xyz += width * normalEC;
gl_Position = czm_projection * positionEC;
gl_Position = czm_depthClampFarPlane(czm_projection * positionEC);

#ifdef ANGLE_VARYING
// Approximate relative screen space direction of the line.
Expand Down

0 comments on commit d3cc317

Please sign in to comment.