智慧水务管理系统 - 精河县供水工程综合管理平台

BufferPointMaterialFS.js 1017B

123456789101112131415161718192021222324252627282930
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "in vec4 v_pickColor;\n\
  3. in vec4 v_color;\n\
  4. in vec4 v_outlineColor;\n\
  5. in float v_innerRadiusFrac;\n\
  6. \n\
  7. void main()\n\
  8. {\n\
  9. // Distance between fragment and point center, 0 to 0.5.\n\
  10. float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n\
  11. float delta = fwidth(distanceToCenter);\n\
  12. \n\
  13. float outerLimit = 0.5;\n\
  14. float innerLimit = 0.5 * v_innerRadiusFrac;\n\
  15. \n\
  16. float outerAlpha = 1.0 - smoothstep(max(0.0, outerLimit - delta), outerLimit, distanceToCenter);\n\
  17. float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter);\n\
  18. \n\
  19. vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha);\n\
  20. color.a *= mix(v_outlineColor.a, v_color.a, innerAlpha);\n\
  21. \n\
  22. if (color.a < 0.005) // matches 0/255 and 1/255\n\
  23. {\n\
  24. discard;\n\
  25. }\n\
  26. \n\
  27. out_FragColor = czm_gammaCorrect(color);\n\
  28. czm_writeLogDepth();\n\
  29. }\n\
  30. ";