/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/Component.glsl.js";import{isOITColorAlpha as i,isOITFrontFace as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as n}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../../../core/shaderTechnique/ShaderTechnique.js";import{depthTest as s,blending as a}from"../../../lib/OrderIndependentTransparency.js";import{stencilBaseAllZeros as p,stencilWriteMaskOn as m,replaceBitWhenDepthTestPasses as u}from"../../../lib/StencilUtils.js";import{IndexGlLayout as c}from"../../../materials/DefaultLayouts.js";import{polygonOffset as d}from"../../../materials/PolygonOffset.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as g,premultipliedAlpha as b,cullingParams as j}from"../../../../../webgl/renderState.js";let P=class extends l{constructor(e,r,i){super(e,r,i.concat(c)),this.shader=new n(t,()=>import("./Component.glsl.js")),this.ignoreUnused=!0}getPipeline(e,r){return e.camera.aboveGround||null==this._belowGroundPipeline?super.getPipeline(e,r):this._belowGroundPipeline}initializePipeline(e){return this._belowGroundPipeline=0===e.integratedMeshMode?null:this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{integratedMeshMode:t,output:n,transparent:l,cullFace:c,hasOccludees:P,renderOccluded:w}=e,T=0!==t,O=!i(n),S=o(n);let _=j(c);return r&&_&&(_={..._,mode:2304}),h({blending:w?b:l?a(n):null,culling:_,depthTest:w?null:s(n),depthWrite:w||!O&&!S?null:g,colorWrite:f,stencilWrite:!w&&T||P?m:null,stencilTest:T?u(1):P?p:null,polygonOffset:d(e)})}};P=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],P);export{P as ComponentTechnique};
