UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.97 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 t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r,depthOnlyOutputBuffersOr as i}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{OITPass as l}from"../lib/OITPass.js";import{oitPolygonOffset as n,depthWrite as o,oitDepthTest as p,blending as a,getDrawBuffers as c}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as O,stencilWriteMaskOn as d}from"../lib/StencilUtils.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{P as f}from"../../../../chunks/Pattern.glsl.js";import{makePipelineState as P,defaultColorWrite as T,cullingParams as h}from"../../../webgl/renderState.js";class S extends r{constructor(e,r){super(e,r,new t(f,(()=>import("./Pattern.glsl.js"))),s()?E:j)}_setPipelineState(t,r){const{oitPass:s,output:m,cullFace:f,draped:S,hasOccludees:j,polygonOffset:E}=t,I=s===l.NONE;return P({blending:e(m)?a(s):null,culling:h(f),depthTest:S?null:{func:p(s)},depthWrite:o(t),drawBuffers:i(m,c(s,m)),colorWrite:T,stencilWrite:j?d:null,stencilTest:j?r?u:O:null,polygonOffset:I?E?R:null:n(t)})}initializePipeline(e){return this._occludeePipelineState=this._setPipelineState(e,!0),this._setPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}const R={factor:1,units:1},j=new Map([[m.POSITION,0],[m.COLOR,3],[m.UVMAPSPACE,4],[m.COLORFEATUREATTRIBUTE,5],[m.BOUNDINGRECT,6]]),E=new Map([[m.POSITION,0],[m.COLOR,3],[m.UVMAPSPACE,4],[m.COLORFEATUREATTRIBUTE,5],[m.BOUNDINGRECT,6],[m.OLIDCOLOR,9]]);export{S as PatternTechnique,j as vertexAttributeLocations,E as vertexAttributeLocationsOID};