UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.82 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as a}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{getSelectionDefines as o,getLocalTileOffset as n,getFeatureUniforms as s,resolveDynamicUniforms as m,getFeaturePipelineState as u}from"../featureTechniqueUtils.js";class l extends r{render(r,l){const{context:c,painter:f}=r,{target:g}=l,{freezeGlobalTime:p}=a,d=0,x=f.textureManager.animationStore.getTexture(c,d),h=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],b=Array.from(e(i(),h)),D=Array.from(t(i(),b,g.transforms.displayViewScreenMat3)),T=l.instance.getInput(),y=f.textureManager.getMosaicInfo(c,l.textureKey,!1),{optionalAttributes:z}=T,R=z.zoomRange,S=z.value1Position2Value2,j="accumulatedDistance"in z&&z.accumulatedDistance,A="segmentDirection"in z&&z.segmentDirection,I="normal"in z&&z.normal;f.setShader({shader:this.shaders.geometry,uniforms:{...m(r,l.target,T.uniforms),...s(r,l.target),mosaicInfo:y,animationInfo:{globalTime:!1===p?r.time/1e3:p,animationTextureSize:[x.descriptor.width,x.descriptor.height],animationTexture:{unit:6,texture:x},toScreen:D,toNdc:h,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:n(l.target)},defines:{...o(r)},optionalAttributes:{zoomRange:R,value1Position2Value2:S,accumulatedDistance:j,segmentDirection:A,normal:I},useComputeBuffer:!0}),f.setPipelineState({...u(r)}),f.submitDraw(r,l),!1===p&&g.requestRender()}}export{l as AnimatedTechnique};