/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as r}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as n}from"../views/webgl/NoParameters.js";import{ShaderBuilder as o}from"../views/webgl/ShaderBuilder.js";class a extends n{}function s(){const n=new o;n.include(e);return n.fragment.uniforms.add(new r("splatOutputDepth",e=>e.splatDepth)),n.fragment.code.add("\n      // we encode near F24 precision into RGB8UNORM  \n      float decodeRGB8ToDepth(vec3 rgb) {\n        // Convert UNORM back to 0..255\n        rgb *= 255.0;\n\n        // Combine high (r), mid (g) and low (b) bytes into 24-bit fixed-point\n        float depth = rgb.r * 65536.0 + rgb.g * 256.0 + rgb.b;\n\n        // Normalize back to [0,1]\n        depth /= 16777215.0;\n\n        return depth;\n      }\n  "),n.fragment.main.add(t`vec4 splatDepth = texture(splatOutputDepth, uv);
float depth = decodeRGB8ToDepth(splatDepth.xyz);
if(splatDepth.a < 1.0) {
discard;
}
gl_FragDepth = depth;`),n}const i=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatDepthCompositionPassParameters:a,build:s},Symbol.toStringTag,{value:"Module"}));export{a as G,i as S,s as b};
