StripeMaterial.js 818 B

1234567891011121314151617181920
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "uniform vec4 evenColor;\n\
  3. uniform vec4 oddColor;\n\
  4. uniform float offset;\n\
  5. uniform float repeat;\n\
  6. uniform bool horizontal;\n\
  7. czm_material czm_getMaterial(czm_materialInput materialInput)\n\
  8. {\n\
  9. czm_material material = czm_getDefaultMaterial(materialInput);\n\
  10. float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\n\
  11. float value = fract((coord - offset) * (repeat * 0.5));\n\
  12. float dist = min(value, min(abs(value - 0.5), 1.0 - value));\n\
  13. vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\n\
  14. vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\n\
  15. color = czm_gammaCorrect(color);\n\
  16. material.diffuse = color.rgb;\n\
  17. material.alpha = color.a;\n\
  18. return material;\n\
  19. }\n\
  20. ";