/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
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 i}from"../materials/internal/MaterialUtil.js";import{NoParameters as s}from"../../../webgl/NoParameters.js";class a{constructor(e,t){this.id=r(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,i(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(r){return!1}setParameters(r,e=!0){i(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 hasEmissions(){return!1}getConfiguration(r,i,s=new t){return s.output=r,s.hasEmission=i.hasEmission&&e(r),s.hasHighlightMixTexture=8===r&&null!=i.highlightMixTexture,s}}class o extends s{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1}}export{a as Material,o as MaterialParameters};
