/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/ComponentShader.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 d,replaceBitWhenDepthTestPasses as m}from"../../../lib/StencilUtils.js";import{IndexGlLayout as u}from"../../../materials/DefaultLayouts.js";import{polygonOffset as c}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(u)),this.shader=new n(t,()=>import("./ComponentShader.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:u,hasOccludees:P,renderOccluded:S}=e,w=0!==t,T=!i(n),O=o(n);let _=j(u);return r&&_&&(_={..._,mode:2304}),h({blending:S?b:l?a(n):null,culling:_,depthTest:S?null:s(n),depthWrite:S||!T&&!O?null:g,colorWrite:f,stencilWrite:!S&&w||P?d:null,stencilTest:w?m(1):P?p:null,polygonOffset:c(e)})}};P=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],P);export{P as ComponentTechnique};
