/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{Float3BindUniform as e}from"../../core/shaderModules/Float3BindUniform.js";import{FloatPassUniform as r}from"../../core/shaderModules/FloatPassUniform.js";import{glsl as o}from"../../core/shaderModules/glsl.js";import{SphereIntersect as s}from"../../shaders/SphereIntersect.glsl.js";import{NoParameters as t}from"../../../../webgl/NoParameters.js";class a extends t{constructor(){super(...arguments),this.atmosphereC=1}}function i(t){t.include(s),t.uniforms.add(new r("atmosphereC",e=>e.atmosphereC),new e("cameraPosition",e=>e.camera.eye)).code.add(o`float getDistanceFalloff(float dist, vec3 rayDir, float weight) {
if(dist == -1.0){
dist = 0.055 * sphereIntersect(cameraPosition, rayDir, atmosphereC).y;
}
return (1.0 - exp(-dist * weight));
}`)}export{a as DistanceFalloffPassParameters,i as getDistanceFalloff};
