PolylineGlowMaterial.js 863 B

123456789101112131415161718192021222324252627
  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. \n\
  6. czm_material czm_getMaterial(czm_materialInput materialInput)\n\
  7. {\n\
  8. czm_material material = czm_getDefaultMaterial(materialInput);\n\
  9. \n\
  10. vec2 st = materialInput.st;\n\
  11. float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\n\
  12. \n\
  13. if (taperPower <= 0.99999) {\n\
  14. glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\n\
  15. }\n\
  16. \n\
  17. vec4 fragColor;\n\
  18. fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\n\
  19. fragColor.a = clamp(0.0, 1.0, glow) * color.a;\n\
  20. fragColor = czm_gammaCorrect(fragColor);\n\
  21. \n\
  22. material.emission = fragColor.rgb;\n\
  23. material.alpha = fragColor.a;\n\
  24. \n\
  25. return material;\n\
  26. }\n\
  27. ";