/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as s}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{ReadShadowMapOrigin as a}from"../../core/shaderLibrary/shading/calculateUVZShadow.glsl.js";import{ShadowHighlightBufferTechnique as h}from"./ShadowHighlightBufferTechnique.js";let n=class extends o{get requireGeometryDepth(){return this.bindParameters.hasShadowHighlights}constructor(e){super(e),this.produces=i.SHADOW_HIGHLIGHT,this._passParameters=new a}render(){const e=this.bindParameters,r=null!=e.depth,t=null!=e.shadowMap.getOutput(6);if(!e.hasShadowHighlights||!r&&!t)return;const o=this.techniques.getCompiled(h);if(!o)return void this.requestRender(1);const{fullWidth:a,fullHeight:n}=e.camera,c=this.fboCache.acquire(a,n,i.SHADOW_HIGHLIGHT,0);this._passParameters.origin=e.camera.center;const d=this.renderingContext;return d.bindFramebuffer(c.fbo),d.clearFramebuffer(s),d.bindTechnique(o,e,this._passParameters),d.screen.draw(),c}};e([r()],n.prototype,"produces",void 0),n=e([t("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlightBuffer")],n);export{n as ShadowHighlightBuffer};
