/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{generateUID as r}from"../../../../core/uid.js";import{isColor as e}from"../core/shaderLibrary/ShaderOutput.js";import{DefaultTechniqueConfiguration as t}from"../materials/DefaultTechniqueConfiguration.js";import{updateParameters as s}from"../materials/internal/MaterialUtil.js";import{NoParameters as i}from"../../../webgl/NoParameters.js";class a{constructor(e,t){this.id=r(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,s(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(r){return!1}setParameters(r,e=!0){s(this._parameters,r)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(r){}shouldRender(r){return this.visible&&this.isVisibleForOutput(r.output)&&(!this.parameters.isDecoration||r.bind.decorations)&&0!==(this.parameters.renderOccluded&r.renderOccludedMask)}isVisibleForOutput(r){return!0}get renderPriority(){return this._renderPriority}set renderPriority(r){r!==this._renderPriority&&(this._renderPriority=r,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return!1}getConfiguration(r,s,i=new t){return i.output=r,i.hasEmission=s.hasEmission&&e(r),i.oitPass=s.oitPass,i.hasHighlightMixTexture=8===r&&null!=s.highlightMixTexture,i}}class n extends i{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}export{a as Material,n as MaterialParameters};
