@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.52 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{_ as t,a as o}from"../../../../../../../chunks/tslib.es6.js";import{GraphShaderModule as e,FragmentOutput as r,location as p,uniform as s,input as i,VertexInput as n,UniformGroup as d,FragmentInput as a}from"../../GraphShaderModule.js";import{Float as l,dot as v,Vec3 as c,Vec2 as y,Vec4 as u,texture2D as f,Mat3 as h,Sampler2D as m}from"../../graph/glsl.js";class x extends n{}t([p(0,y)],x.prototype,"pos",void 0),t([p(1,y)],x.prototype,"uv",void 0);class g extends a{}class w extends d{}t([s(h)],w.prototype,"dvs",void 0);class S extends d{}t([s(y)],S.prototype,"perspective",void 0),t([s(y)],S.prototype,"texSize",void 0),t([s(l)],S.prototype,"wrapAroundShift",void 0),t([s(l)],S.prototype,"opacity",void 0),t([s(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 l(1).add(v(o,this.config.perspective)),r=new c(t.pos.add(new y(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([s(w)],j.prototype,"transform",void 0),t([s(S)],j.prototype,"config",void 0),t([o(0,i(x))],j.prototype,"vertex",null),t([o(0,i(g))],j.prototype,"fragment",null);export{j as OverlayShader};