/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as i,initial as s}from"../../../../../core/reactiveUtils.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{OpaqueEnvironment as o}from"../OpaqueEnvironment.js";import{CloudsCompositionTechnique as n}from"./CloudsCompositionTechnique.js";import{createQuadVAO as a}from"../../lib/glUtil3D.js";import{ColorAttachment0 as m,PrimitiveType as d}from"../../../../webgl/enums.js";import{noParameters as l}from"../../../../webgl/NoParameters.js";let h=class extends o{initialize(){this.addHandles([i(()=>null!=this.view.environment.weather&&this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),s)])}destroy(){this._vao=t(this._vao)}render(e){const t=e.find(({name:e})=>e===this.produces),i=this.bindParameters.clouds;if(!i.data)return t;const s=this.techniques.getCompiled(n);if(!s)return this.requestRender(1),t;const r=this.renderingContext;this._vao??=a(r);const o=r.bindTechnique(s,this.bindParameters,l);return r.setDrawBuffers([m]),r.bindVAO(this._vao),o.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(d.TRIANGLE_STRIP,0,4),i.isFading&&this.requestRender(2),t}};h=e([r("esri.views.3d.webgl-engine.effects.clouds.CloudsComposition")],h);export{h as CloudsComposition};
