"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getTrailPolylineMaterial = void 0;
var Cesium = _interopRequireWildcard(require("cesium"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var glsl = "\n  czm_material czm_getMaterial(czm_materialInput materialInput) {\n    czm_material material = czm_getDefaultMaterial(materialInput);\n    vec2 st = materialInput.st;\n    vec4 colorImage = texture2D(image, vec2(fract((st.s - speed * czm_frameNumber * 0.001)), st.t));\n    material.alpha = colorImage.a;\n    material.diffuse = colorImage.rgb;\n    return material;\n  }";
var getTrailPolylineMaterial = exports.getTrailPolylineMaterial = function getTrailPolylineMaterial(image) {
  var speed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
  return new Cesium.Material({
    strict: false,
    fabric: {
      uniforms: {
        image: image,
        speed: speed
      },
      source: glsl
    },
    translucent: function translucent() {
      return true;
    },
    minificationFilter: Cesium.TextureMinificationFilter.LINEAR,
    magnificationFilter: Cesium.TextureMagnificationFilter.LINEAR
  });
};
//# sourceMappingURL=TrailPolylineMaterial.js.map
