CompareAndPackTranslucentDepth.glsl 455 B

123456789101112
  1. uniform sampler2D u_opaqueDepthTexture;
  2. uniform sampler2D u_translucentDepthTexture;
  3. in vec2 v_textureCoordinates;
  4. void main()
  5. {
  6. float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;
  7. float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;
  8. translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
  9. out_FragColor = czm_packDepth(translucentDepth);
  10. }