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