Newer
Older
casic-smartcity-well-front / static / Cesium / Shaders / CompareAndPackTranslucentDepth.glsl
[wangxitong] on 8 Jul 2021 463 bytes mars3d总览
uniform sampler2D u_opaqueDepthTexture;
uniform sampler2D u_translucentDepthTexture;

varying vec2 v_textureCoordinates;

void main()
{
    float opaqueDepth = texture2D(u_opaqueDepthTexture, v_textureCoordinates).r;
    float translucentDepth = texture2D(u_translucentDepthTexture, v_textureCoordinates).r;
    translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
    gl_FragColor = czm_packDepth(translucentDepth);
}