/*
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","../../../ViewingMode","../core/shaderLibrary/ShaderOutputOptions","../core/shaderTechnique/ReloadableShaderModule","../core/shaderTechnique/ShaderTechnique","../lib/basicInterfaces","../lib/DefaultVertexAttributeLocations","../lib/OrderIndependentTransparency","../lib/Program","../../../../chunks/HUDMaterial.glsl","../../../webgl/enums","../../../webgl/renderState"],(function(e,t,i,n,r,a,o,u,l,s,c,p,d,h){"use strict";let g=function(e){function t(){return e.apply(this,arguments)||this}i._inheritsLoose(t,e);var a=t.prototype;return a.initializeConfiguration=function(e,t){t.spherical=e.viewingMode===n.ViewingMode.Global},a.initializeProgram=function(e){const i=t.shader.get().build(this.configuration);return new c.Program(e.rctx,i,l.Default3D)},a._setPipelineState=function(e){const t=this.configuration,i=e===u.TransparencyPassType.NONE,n=e===u.TransparencyPassType.FrontFace,a=this.configuration.hasPolygonOffset&&f,o=(i||n)&&t.output!==r.ShaderOutput.Highlight?(t.depthEnabled||t.output===r.ShaderOutput.Occlusion)&&h.defaultDepthWriteParams:null;return h.makePipelineState({blending:t.output===r.ShaderOutput.Color||t.output===r.ShaderOutput.Alpha||t.output===r.ShaderOutput.Highlight?i?P:s.oitBlending(e):null,depthTest:{func:d.CompareFunction.LEQUAL},depthWrite:o,colorWrite:h.defaultColorWriteParams,polygonOffset:a})},a.initializePipeline=function(){return this._setPipelineState(this.configuration.transparencyPassType)},i._createClass(t,[{key:"primitiveType",get:function(){return this.configuration.output===r.ShaderOutput.Occlusion?d.PrimitiveType.POINTS:d.PrimitiveType.TRIANGLES}}]),t}(o.ShaderTechnique);g.shader=new a.ReloadableShaderModule(p.HUDMaterial,(()=>new Promise(((t,i)=>e(["./HUDMaterial.glsl"],t,i)))));const f={factor:0,units:-4},P=h.simpleBlendingParams(d.BlendFactor.ONE,d.BlendFactor.ONE_MINUS_SRC_ALPHA);t.HUDMaterialTechnique=g,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
