@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.96 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{IntegratedMeshMode as e}from"./ComponentTechniqueConfiguration.js";import{C as r}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColorOrColorEmission as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as n}from"../../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o,depthOnlyOutputBuffersOr as s}from"../../../core/shaderTechnique/ShaderTechnique.js";import{StencilBits as i}from"../../../lib/basicInterfaces.js";import{OITPass as l}from"../../../lib/OITPass.js";import{OITPolygonOffset as a,oitDepthTest as c,blending as d,getDrawBuffers as u}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as m,stencilBaseAllZerosParams as p,stencilWriteMaskOn as f}from"../../../lib/StencilUtils.js";import{VertexAttribute as h}from"../../../lib/VertexAttribute.js";import{makePipelineState as O,defaultColorWrite as b,defaultDepthWrite as j,cullingParams as g,premultipliedAlpha as M}from"../../../../../webgl/renderState.js";class N extends o{constructor(e,t){super(e,t,new n(r,(()=>import("./shader/ComponentShader.glsl.js"))),S)}initializePipeline(r){const{integratedMeshMode:n,output:o,blendingEnabled:h,cullFace:N,hasOccludees:S,hasPolygonOffset:T,oitPass:C,renderOccluded:E}=r,I=n!==e.None,P=C===l.NONE,R=C===l.FrontFace;return O({blending:E?M:t(o)&&h?d(C):null,culling:g(N),depthTest:E?null:{func:c(C)},depthWrite:E||!P&&!R?null:j,drawBuffers:s(o,u(C,o)),colorWrite:b,stencilWrite:!E&&I||S?f:null,stencilTest:I?m(i.IntegratedMeshMaskExcluded):S?p:null,polygonOffset:P||R?T?{factor:2,units:2}:null:a})}}const S=new Map([[h.POSITION,0],[h.NORMAL,1],[h.NORMALCOMPRESSED,1],[h.COLOR,2],[h.UV0,3],[h.UVREGION,4],[h.COMPONENTINDEX,5]]);export{N as ComponentTechnique,S as vertexAttributeLocations};