/*
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","../core/shaderLibrary/ShaderOutputOptions","../lib/basicInterfaces","../lib/GLMaterials","../lib/GLTextureMaterial","../lib/Material","../lib/OrderIndependentTransparency","../lib/RenderSlot","./internal/DefaultBufferWriter","./internal/MaterialUtil","../shaders/ImageMaterialTechnique"],(function(e,t,r,a,i,n,u,s,l,o,h,c){"use strict";let p=function(e){function a(t){var r;return(r=e.call(this,t,new f)||this).supportsEdges=!0,r.techniqueConfig=new c.ImageMaterialTechniqueConfiguration,r}t._inheritsLoose(a,e);var n=a.prototype;return n.getConfiguration=function(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.cullFace=this.parameters.cullFace,this.techniqueConfig.hasSlicePlane=this.parameters.hasSlicePlane,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.hasOccludees=this.parameters.hasOccludees,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<s.OITPolygonOffsetLimit,this.techniqueConfig.hasMultipassTerrain=t.multipassTerrain.enabled,this.techniqueConfig.cullAboveGround=t.multipassTerrain.cullAboveGround,this.techniqueConfig},n.intersect=function(e,t,r,a,i,n,u){h.intersectTriangleGeometry(e,t,a,i,n,void 0,u)},n.requiresSlot=function(e,t){if(e===l.RenderSlot.DRAPED_MATERIAL)return!0;if(i.outputFromPass(t)===r.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)},n.createGLMaterial=function(e){return e.output===r.ShaderOutput.Color||e.output===r.ShaderOutput.Alpha||e.output===r.ShaderOutput.Highlight?new d(e):void 0},n.createBufferWriter=function(){return new o.DefaultBufferWriter(o.PositionUVLayout)},a}(u.Material),d=function(e){function a(t){return e.call(this,{...t,...t.material.parameters})||this}t._inheritsLoose(a,e);var i=a.prototype;return i._updateParameters=function(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(c.ImageMaterialTechnique,e)},i._updateOccludeeState=function(e){e.hasOccludees!==this._material.parameters.hasOccludees&&(this._material.setParameters({hasOccludees:e.hasOccludees}),this._updateParameters(e))},i.beginSlot=function(e){return this._output!==r.ShaderOutput.Color&&this._output!==r.ShaderOutput.Alpha||this._updateOccludeeState(e),this._updateParameters(e)},a}(n.GLTextureMaterial),f=function(e){function r(){var t;return(t=e.apply(this,arguments)||this).transparent=!1,t.writeDepth=!0,t.hasSlicePlane=!1,t.cullFace=a.CullFaceOptions.None,t.hasOccludees=!1,t.opacity=1,t.textureId=null,t.initTextureTransparent=!0,t}return t._inheritsLoose(r,e),r}(u.MaterialParameters);e.ImageMaterial=p,e.Parameters=f,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
