/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t,__param as o}from"tslib";import{location as e,uniform as r,texture as p,input as i,VertexInput as s,UniformGroup as n,GraphShaderModule as d,FragmentOutput as l,FragmentInput as v}from"../../GraphShaderModule.js";import{Vec2 as a,Mat3 as y,Float as c,Sampler2D as u,dot as f,Vec3 as h,Vec4 as m,texture2D as x}from"../../graph/glsl.js";class g extends s{}t([e(0,a)],g.prototype,"pos",void 0),t([e(1,a)],g.prototype,"uv",void 0);class w extends v{}class S extends n{}t([r(y)],S.prototype,"dvs",void 0);class j extends n{}t([r(a)],j.prototype,"perspective",void 0),t([r(a)],j.prototype,"texSize",void 0),t([r(c)],j.prototype,"wrapAroundShift",void 0),t([r(c)],j.prototype,"opacity",void 0);class z extends d{constructor(){super(...arguments),this.type="OverlayShader"}vertex(t){const o=t.uv.divide(this.config.texSize),e=new c(1).add(f(o,this.config.perspective)),r=new h(t.pos.add(new a(this.config.wrapAroundShift,0)),1),p=this.transform.dvs.multiply(r);return{uv:o,glPosition:new m(p.xy.multiply(e),0,e)}}fragment(t){const o=x(this.texture,t.uv).multiply(this.config.opacity),e=new l;return e.fragColor=o,e}}t([r(S)],z.prototype,"transform",void 0),t([r(j)],z.prototype,"config",void 0),t([p(u)],z.prototype,"texture",void 0),t([o(0,i(g))],z.prototype,"vertex",null),t([o(0,i(w))],z.prototype,"fragment",null);export{z as OverlayShader};
