/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{glsl as e}from"../core/shaderModules/glsl.js";function a(a){a.code.add(e`float mapChannel(float x, vec2 p) {
return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
}`),a.code.add(e`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
}`)}export{a as BlackLevelLightSoftCompression};
