text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/4.10/esri/copyright.txt for details.
  //>>built
  define("require exports ../../../core/libs/gl-matrix-2/gl-matrix ./resources/SimpleAtmosphereTexture ../support/imageUtils ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/GeometryUtil ../webgl-engine/lib/Util ../webgl-engine/shaders/SimpleAtmospherePrograms ../../webgl/BufferObject ../../webgl/programUtils ../../webgl/Texture ../../webgl/Util ../../webgl/Util ../../webgl/VertexArrayObject".split(" "),function(h,C,k,q,r,t,u,v,l,m,w,x,y,z,A,B){h=function(){function e(d){this.needsRender=
  !1;this.didRender=!0;this.slot=16;this.view=d}e.prototype.destroy=function(){this._program&&(this._program.dispose(),this._program=null);this._texture&&(this._texture.dispose(),this._texture=null);this._readyPromise&&(this._readyPromise.cancel(),this._readyPromise=null)};e.prototype.when=function(d){return this._readyPromise.then(d)};e.prototype.initializeRenderContext=function(d){var a=this,c=d.rctx;this._program=x.createProgram(c,m.colorPass,{panoramic:!0});this._vao=this._createVertexArrayObject(c);
  this._vaoCount=A.vertexCount(this._vao,"geometry");this._readyPromise=r.requestImage(q).then(function(b){a._texture=new y(d.rctx,{pixelFormat:6408,dataType:5121,wrapMode:33071,samplingMode:9729,flipped:!0},b);a.needsRender=!0})};e.prototype.uninitializeRenderContext=function(d){this.destroy()};e.prototype.render=function(d){if(d.slot!==this.slot||0!==d.pass||null==this._texture)return!1;var a=d.rctx,c=this._program;a.bindProgram(c);a.bindTexture(this._texture);c.setUniform1i("tex",0);c.setUniformMatrix4fv("proj",
  d.camera.projectionMatrix);var b=n;k.mat4.copy(b,d.camera.viewMatrix);b[12]=0;b[13]=0;b[14]=0;b[15]=1;c.setUniformMatrix4fv("view",n);c.setUniform4f("color",1,1,1,1);c.setUniform3fv("lightDirection",d.lightingData.direction);a.setDepthTestEnabled(!0);a.setFaceCullingEnabled(!0);a.setFrontFace(2305);a.setCullFace(1029);a.setDepthFunction(515);a.setBlendingEnabled(!0);a.setDepthWriteEnabled(!1);a.bindVAO(this._vao);z.assertCompatibleVertexAttributeLocations(this._vao,c);a.drawArrays(4,0,this._vaoCount);
  a.setDepthWriteEnabled(!0);a.setBlendingEnabled(!1);a.setDepthFunction(513);a.setFaceCullingEnabled(!1);return!0};e.prototype._createVertexArrayObject=function(d){for(var a=v.createPolySphereGeometry(1,2,!1),c=a.indices[l.VertexAttrConstants.POSITION],b=0;b<c.length;b+=3){var e=c[b];c[b]=c[b+2];c[b+2]=e}for(var a=a.vertexAttributes[l.VertexAttrConstants.POSITION].data,e=p.createBuffer(c.length),f=e.position,b=0;b<c.length;++b){var g=3*c[b];f.set(b,0,a[g]);f.set(b,1,a[g+1]);f.set(b,2,a[g+2])}return new B(d,
  m.colorPass.attributes,{geometry:t.glLayout(p)},{geometry:w.createVertex(d,35044,e.buffer)})};return e}();var n=k.mat4f64.create(),p=u.newLayout().vec3f("position");return h});