You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PolylineImageTrailMaterial.glsl 637B

12345678910111213141516171819
  1. uniform sampler2D image;
  2. uniform float speed;
  3. uniform vec4 color;
  4. uniform vec2 repeat;
  5. czm_material czm_getMaterial(czm_materialInput materialInput){
  6. czm_material material = czm_getDefaultMaterial(materialInput);
  7. vec2 st = repeat * materialInput.st;
  8. float time = fract(czm_frameNumber * speed / 1000.0);
  9. vec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));
  10. if(color.a == 0.0){
  11. material.alpha = colorImage.a;
  12. material.diffuse = colorImage.rgb;
  13. }else{
  14. material.alpha = colorImage.a * color.a;
  15. material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);
  16. }
  17. return material;
  18. }