PointPrimitiveCollectionFS.js 962 B

123456789101112131415161718192021222324252627282930313233343536
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "varying vec4 v_color;\n\
  3. varying vec4 v_outlineColor;\n\
  4. varying float v_innerPercent;\n\
  5. varying float v_pixelDistance;\n\
  6. varying vec4 v_pickColor;\n\
  7. void main()\n\
  8. {\n\
  9. float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n\
  10. float maxDistance = max(0.0, 0.5 - v_pixelDistance);\n\
  11. float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\n\
  12. float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\n\
  13. vec4 color = mix(v_outlineColor, v_color, innerAlpha);\n\
  14. color.a *= wholeAlpha;\n\
  15. #if !defined(OPAQUE) && !defined(TRANSLUCENT)\n\
  16. if (color.a < 0.005)\n\
  17. {\n\
  18. discard;\n\
  19. }\n\
  20. #else\n\
  21. #ifdef OPAQUE\n\
  22. if (color.a < 0.995)\n\
  23. {\n\
  24. discard;\n\
  25. }\n\
  26. #else\n\
  27. if (color.a >= 0.995)\n\
  28. {\n\
  29. discard;\n\
  30. }\n\
  31. #endif\n\
  32. #endif\n\
  33. gl_FragColor = czm_gammaCorrect(color);\n\
  34. czm_writeLogDepth();\n\
  35. }\n\
  36. ";