CompositeOITFS.js 762 B

12345678910111213141516171819202122
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "uniform sampler2D u_opaque;\n\
  3. uniform sampler2D u_accumulation;\n\
  4. uniform sampler2D u_revealage;\n\
  5. varying vec2 v_textureCoordinates;\n\
  6. void main()\n\
  7. {\n\
  8. vec4 opaque = texture2D(u_opaque, v_textureCoordinates);\n\
  9. vec4 accum = texture2D(u_accumulation, v_textureCoordinates);\n\
  10. float r = texture2D(u_revealage, v_textureCoordinates).r;\n\
  11. #ifdef MRT\n\
  12. vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n\
  13. #else\n\
  14. vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n\
  15. #endif\n\
  16. gl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n\
  17. if (opaque != czm_backgroundColor)\n\
  18. {\n\
  19. gl_FragColor.a = 1.0;\n\
  20. }\n\
  21. }\n\
  22. ";