UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.68 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,oitDepthTest as n,blending as s,getDrawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u,stencilWriteMaskOn as a,stencilToolTransparentOccluderParams as d,depthCompareAlways as T,stencilToolMaskOccluderParams as h,stencilWriteMaskOff as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{L as O}from"../../../../chunks/LineMarker.glsl.js";import{LineMarkerSpace as R}from"./LineMarkerTechniqueConfiguration.js";import{makePipelineState as f,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as A}from"../../../webgl/renderState.js";class S extends t{constructor(e,t){super(e,t,new i(O,(()=>import("./LineMarker.glsl.js"))),W)}_makePipelineState(i,t){const{output:p,oitPass:d,space:T,hasOccludees:h}=i;return f({blending:e(p)?s(d):null,depthTest:T===R.Draped?null:{func:n(d)},depthWrite:l(i),drawBuffers:r(p,o(d,p)),colorWrite:_,stencilWrite:h?a:null,stencilTest:h?t?c:u:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:d}),this._occluderPipelineOpaque=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:m,stencilTest:h}),this._occluderPipelineMaskWrite=f({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:c})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,i){return e?this._occludeePipelineState:i===p.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent??super.getPipeline():i===p.OCCLUDER_MATERIAL?this._occluderPipelineOpaque??super.getPipeline():this._occluderPipelineMaskWrite??super.getPipeline()}}const W=new Map([[E.POSITION,0],[E.PREVIOUSDELTA,1],[E.UV0,2],[E.COLOR,3],[E.COLORFEATUREATTRIBUTE,3],[E.OPACITYFEATUREATTRIBUTE,4],[E.SIZE,5],[E.SIZEFEATUREATTRIBUTE,5],[E.NORMAL,6]]);export{S as LineMarkerTechnique,W as vertexAttributeLocations};