@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 2.01 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 e}from"../../../../../../../chunks/tslib.es6.js";import{location as s,uniform as i,define as l,input as o,UniformGroup as r}from"../../GraphShaderModule.js";import{Float as a,Vec3 as p,Vec4 as n,length as u,step as m,Vec2 as d}from"../../graph/glsl.js";import{AFeatureShader as y,FeatureVertexInput as h,FeatureFragmentInput as c}from"./AFeatureShader.js";import{getHeatmapCompressionFactor as f}from"./heatmapUtils.js";import{hittestMarker as w}from"./hittestUtils.js";class v extends h{}t([s(5,d)],v.prototype,"offset",void 0);class x extends c{}class g extends r{}t([i(a)],g.prototype,"radius",void 0),t([i(a)],g.prototype,"isFieldActive",void 0);class F extends y{constructor(){super(...arguments),this.type="HeatmapAccumulateShader",this.usesHalfFloatPrecision=!1}vertex(t){const{radius:e,isFieldActive:s}=this.kernelControls,i=t.offset,l=s.multiply(this.storage.getVVData(t.id).x).add(new a(1).subtract(s)),o=this.view.displayViewScreenMat3.multiply(new p(t.pos,1)).add(this.view.displayViewMat3.multiply(new p(i,0)).multiply(e)),r=this.clip(t.id);return{glPosition:new n(o.xy,r,1),offset:i,fieldValue:l,color:new n(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:e,fieldValue:s}=t,i=u(e),l=m(i,new a(1)),o=new a(1).subtract(i.multiply(i)),r=o.multiply(o),p=l.multiply(r).multiply(s).multiply(new a(f(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new n(p),t)}hittest(t){const{viewMat3:e,tileMat3:s}=this.view,i=e.multiply(s).multiply(new p(t.pos,1));return w(i.xy,this.kernelControls.radius,this.hittestRequest.position)}}t([l],F.prototype,"usesHalfFloatPrecision",void 0),t([i(g)],F.prototype,"kernelControls",void 0),t([e(0,o(v))],F.prototype,"vertex",null),t([e(0,o(x))],F.prototype,"fragment",null);export{x as HeatmapAccumulateFragmentInput,F as HeatmapAccumulateShader,v as HeatmapAccumulateVertexInput};