/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/vec4f64","../core/shaderLibrary/ShaderOutputOptions","../lib/basicInterfaces","../lib/GLMaterial","../lib/GLMaterials","../lib/Material","../lib/OrderIndependentTransparency","../lib/RenderSlot","./internal/DefaultBufferWriter","./internal/MaterialUtil","../shaders/ColorMaterialTechnique","../shaders/ColorMaterialTechniqueConfiguration"],(function(e,t,r,i,a,n,s,o,u,l,h,c,p,f){"use strict";let d=function(e){function r(t){var r;return(r=e.call(this,t,new g)||this).supportsEdges=!0,r._configuration=new f.ColorMaterialTechniqueConfiguration,r}t._inheritsLoose(r,e);var a=r.prototype;return a.getConfiguration=function(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<u.OITPolygonOffsetLimit,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration},a.intersect=function(e,t,r,i,a,n,s){c.intersectTriangleGeometry(e,t,i,a,n,void 0,s)},a.requiresSlot=function(e,t){if(e===l.RenderSlot.DRAPED_MATERIAL)return!0;if(s.outputFromPass(t)===i.ShaderOutput.Highlight)return e===l.RenderSlot.OPAQUE_MATERIAL;return e===(this.parameters.transparent?this.parameters.writeDepth?l.RenderSlot.TRANSPARENT_MATERIAL:l.RenderSlot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:l.RenderSlot.OPAQUE_MATERIAL)},a.createGLMaterial=function(e){return e.output===i.ShaderOutput.Color||e.output===i.ShaderOutput.Alpha||e.output===i.ShaderOutput.Highlight||e.output===i.ShaderOutput.Depth&&this.parameters.writeLinearDepth?new _(e):null},a.createBufferWriter=function(){return new h.DefaultBufferWriter(h.PositionColorLayout)},r}(o.Material),_=function(e){function r(){return e.apply(this,arguments)||this}t._inheritsLoose(r,e);var a=r.prototype;return a._updateOccludeeState=function(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})},a.beginSlot=function(e){return this._output!==i.ShaderOutput.Color&&this._output!==i.ShaderOutput.Alpha||this._updateOccludeeState(e),this.ensureTechnique(p.ColorMaterialTechnique,e)},r}(n),g=function(e){function i(){var t;return(t=e.apply(this,arguments)||this).color=r.ZEROS,t.transparent=!1,t.writeDepth=!0,t.writeLinearDepth=!1,t.hasVertexColors=!1,t.polygonOffset=!1,t.hasSlicePlane=!1,t.cullFace=a.CullFaceOptions.None,t.hasOccludees=!1,t}return t._inheritsLoose(i,e),i}(o.MaterialParameters);e.ColorMaterial=d,e.Parameters=g,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
