/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["require","exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/tslib.es6","../core/shaderLibrary/ShaderOutputOptions","../core/shaderTechnique/ReloadableShaderModule","../core/shaderTechnique/ShaderTechnique","../core/shaderTechnique/ShaderTechniqueConfiguration","../lib/basicInterfaces","../lib/OrderIndependentTransparency","../lib/Program","../lib/VertexAttribute","../materials/DefaultTechniqueConfiguration","../../../../chunks/ShadedColorMaterial.glsl","../../../webgl/enums","../../../webgl/renderState"],(function(e,t,r,a,n,o,i,l,u,p,s,c,d,h,S,y){"use strict";let T=function(e){function t(){return e.apply(this,arguments)||this}r._inheritsLoose(t,e);var a=t.prototype;return a.initializeProgram=function(e){const r=t.shader.get().build(this.configuration);return new s.Program(e.rctx,r,f)},a._setPipelineState=function(e){const t=this.configuration,r=e===u.TransparencyPassType.NONE,a=e===u.TransparencyPassType.FrontFace;return y.makePipelineState({blending:t.output!==n.ShaderOutput.Color&&t.output!==n.ShaderOutput.Alpha||!t.transparent?null:r?p.blendingDefault:p.oitBlending(e),culling:y.cullingParams(t.cullFace),depthTest:{func:a?S.CompareFunction.LESS:t.shadingEnabled?S.CompareFunction.LEQUAL:S.CompareFunction.LESS},depthWrite:r?t.writeDepth&&y.defaultDepthWriteParams:p.oitDepthWrite(e),colorWrite:y.defaultColorWriteParams,polygonOffset:r||a?null:p.OITPolygonOffset})},a.initializePipeline=function(){return this._setPipelineState(this.configuration.transparencyPassType)},t}(i.ShaderTechnique);T.shader=new o.ReloadableShaderModule(h.ShadedColorMaterialShader,(()=>new Promise(((t,r)=>e(["./ShadedColorMaterial.glsl"],t,r)))));let b=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).output=n.ShaderOutput.Color,t.cullFace=u.CullFaceOptions.None,t.transparencyPassType=u.TransparencyPassType.NONE,t.hasSlicePlane=!1,t.transparent=!1,t.writeDepth=!0,t.screenSizeEnabled=!0,t.shadingEnabled=!0,t.hasMultipassTerrain=!1,t.cullAboveGround=!1,t}return r._inheritsLoose(t,e),t}(d.DefaultTechniqueConfiguration);a.__decorate([l.parameter({count:n.ShaderOutput.COUNT})],b.prototype,"output",void 0),a.__decorate([l.parameter({count:u.CullFaceOptions.COUNT})],b.prototype,"cullFace",void 0),a.__decorate([l.parameter({count:u.TransparencyPassType.COUNT})],b.prototype,"transparencyPassType",void 0),a.__decorate([l.parameter()],b.prototype,"hasSlicePlane",void 0),a.__decorate([l.parameter()],b.prototype,"transparent",void 0),a.__decorate([l.parameter()],b.prototype,"writeDepth",void 0),a.__decorate([l.parameter()],b.prototype,"screenSizeEnabled",void 0),a.__decorate([l.parameter()],b.prototype,"shadingEnabled",void 0),a.__decorate([l.parameter()],b.prototype,"hasMultipassTerrain",void 0),a.__decorate([l.parameter()],b.prototype,"cullAboveGround",void 0);const f=new Map([[c.VertexAttribute.POSITION,0],[c.VertexAttribute.NORMAL,1],[c.VertexAttribute.OFFSET,2]]);t.ShadedColorMaterialTechnique=T,t.ShadedColorMaterialTechniqueConfiguration=b,t.ShadedColorMaterialVertexAttrLocations=f,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
