UNPKG

casc-cesium

Version:

Vue 3.x components for CesiumJS.

3 lines (2 loc) 1.07 kB
declare const text = "\nuniform sampler2D segmentsColorTexture;\nuniform sampler2D segmentsDepthTexture;\n\nuniform sampler2D currentTrailsColor;\nuniform sampler2D trailsDepthTexture;\n\nuniform float fadeOpacity;\n\nvarying vec2 textureCoordinate;\n\nvoid main() {\n vec4 pointsColor = texture2D(segmentsColorTexture, textureCoordinate);\n vec4 trailsColor = texture2D(currentTrailsColor, textureCoordinate);\n\n trailsColor = floor(fadeOpacity * 255.0 * trailsColor) / 255.0; // make sure the trailsColor will be strictly decreased\n\n float pointsDepth = texture2D(segmentsDepthTexture, textureCoordinate).r;\n float trailsDepth = texture2D(trailsDepthTexture, textureCoordinate).r;\n float globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, textureCoordinate));\n\n gl_FragColor = vec4(0.0);\n if (pointsDepth < globeDepth) {\n gl_FragColor = gl_FragColor + pointsColor;\n }\n if (trailsDepth < globeDepth) {\n gl_FragColor = gl_FragColor + trailsColor;\n }\n gl_FragDepthEXT = min(pointsDepth, trailsDepth);\n}\n"; export default text;