/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","./mat4","./mat4f64","../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl","../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl","../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl","../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl","../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl","../views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl","../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl","../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl","../views/3d/webgl-engine/core/shaderModules/Float3PassUniform","../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/lib/VertexAttribute"],(function(e,i,r,a,n,o,s,l,d,t,g,c,u,b,v,w){"use strict";function h(){const e=new v.ShaderBuilder;e.attributes.add(w.VertexAttribute.POSITION,"vec2"),e.varyings.add("worldRay","vec3");const{vertex:r,fragment:h}=e;return r.uniforms.add([new b.Matrix4PassUniform("inverseProjectionMatrix",((e,i)=>i.camera.inverseProjectionMatrix)),new b.Matrix4PassUniform("inverseViewMatrix",((e,r)=>i.invert(m,r.camera.viewMatrix)))]),r.code.add(u.glsl`void main(void) {
vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1.0, 1.0)).xyz;
worldRay = (inverseViewMatrix * vec4(posViewNear, 0.0)).xyz;
gl_Position = vec4(position, 1.0, 1.0);
}`),h.include(t.ColorConversion),h.include(g.RgbaFloatEncoding),e.include(a.EvaluateAmbientLighting,{pbrMode:s.PBRMode.Disabled,lightingSphericalHarmonicsOrder:2}),e.include(l.PiUtils),e.include(n.Gamma),e.include(o.MainLighting,{isGround:!1}),e.include(d.CloudsParallaxShading,{instancedDoublePrecision:!1,isGround:!1}),h.uniforms.add([new c.Float3PassUniform("cameraPosition",((e,i)=>i.camera.eye))]),h.code.add(u.glsl`void main() {
vec4 cloudsColor = renderClouds(normalize(worldRay), cameraPosition);
gl_FragColor = vec4((1.0 - totalFadeInOut) * cloudsColor.rgb, cloudsColor.a);
}`),e}const m=r.create(),P=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}));e.CloudsCompositionShader=P,e.build=h}));
