PolylineGlowMaterial.js 809 B

12345678910111213141516171819202122
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "uniform vec4 color;\n\
  3. uniform float glowPower;\n\
  4. uniform float taperPower;\n\
  5. varying float v_width;\n\
  6. czm_material czm_getMaterial(czm_materialInput materialInput)\n\
  7. {\n\
  8. czm_material material = czm_getDefaultMaterial(materialInput);\n\
  9. vec2 st = materialInput.st;\n\
  10. float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\n\
  11. if (taperPower <= 0.99999) {\n\
  12. glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\n\
  13. }\n\
  14. vec4 fragColor;\n\
  15. fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\n\
  16. fragColor.a = clamp(0.0, 1.0, glow) * color.a;\n\
  17. fragColor = czm_gammaCorrect(fragColor);\n\
  18. material.emission = fragColor.rgb;\n\
  19. material.alpha = fragColor.a;\n\
  20. return material;\n\
  21. }\n\
  22. ";