UNPKG

@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
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{_ as t,a as o}from"../../../../../../../chunks/tslib.es6.js";import{location as e,uniform as r,GraphShaderModule as p,VertexInput as s,UniformGroup as i,FragmentOutput as n,input 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 s{}t([e(0,y)],x.prototype,"pos",void 0),t([e(1,y)],x.prototype,"uv",void 0);class g extends a{}class w extends i{}t([r(h)],w.prototype,"dvs",void 0);class S extends i{}t([r(y)],S.prototype,"perspective",void 0),t([r(y)],S.prototype,"texSize",void 0),t([r(l)],S.prototype,"wrapAroundShift",void 0),t([r(l)],S.prototype,"opacity",void 0),t([r(m)],S.prototype,"texture",void 0);class j extends p{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 n;return e.fragColor=o,e}}t([r(w)],j.prototype,"transform",void 0),t([r(S)],j.prototype,"config",void 0),t([o(0,d(x))],j.prototype,"vertex",null),t([o(0,d(g))],j.prototype,"fragment",null);export{j as OverlayShader};