/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass","../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl","../views/3d/webgl-engine/core/shaderModules/FloatPassUniform","../views/3d/webgl-engine/core/shaderModules/interfaces","../views/3d/webgl-engine/core/shaderModules/ShaderBuilder","../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform"],(function(e,i,r,s,n,a,t){"use strict";function d(){const e=new a.ShaderBuilder;return e.include(i.ScreenSpacePass),e.include(r.DiscardOrAdjustAlphaBlend),e.fragment.uniforms.add([new t.Texture2DPassUniform("densityMap",(e=>e.densityMap)),new t.Texture2DPassUniform("tex",(e=>e.colorRamp)),new s.FloatPassUniform("densityNormalizer",(e=>1/(e.maxDensity-e.minDensity))),new s.FloatPassUniform("minDensity",(e=>e.minDensity))]),e.fragment.uniforms.add(new s.FloatPassUniform("densityMultiplier",(e=>3/(e.searchRadius*e.searchRadius*Math.PI)))),e.fragment.code.add(n.glsl`void main() {
float density = texture2D(densityMap, uv).r * densityMultiplier;
float densityRatio = (density - minDensity) * densityNormalizer;
vec4 color = texture2D(tex, vec2(clamp(densityRatio, 0.0, 1.0), 0.5));
discardOrAdjustAlpha(color);
gl_FragColor = color;
}`),e}const o=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}));e.HeatmapShader=o,e.build=d}));
