declare const _default: "\n #include \"gammaPS\"\n #include \"tonemappingPS\"\n\n #ifdef PREPASS_PASS\n varying float vLinearDepth;\n #include \"floatAsUintPS\"\n #endif\n\n varying vec3 vViewDir;\n\n #include \"dynamicSkyAtmospherePS\"\n\n #if defined(DYNSKY_CLOUDS_FLAT) || defined(DYNSKY_CLOUDS_VOLUMETRIC)\n #include \"dynamicSkyCloudsPS\"\n #endif\n\n #ifdef DYNSKY_CLOUDS_BUFFER\n uniform sampler2D dynSkyCloudBuffer;\n uniform mat3 dynSkyBufferMatrix; // the sky direction to the view space of the camera\n uniform vec2 dynSkyBufferProj; // the scale of the camera projection\n\n #ifdef DYNSKY_CLOUDS_ENCODED\n uniform float dynSkyCloudScale;\n #endif\n\n vec4 dynamicSkyCloudsTap(vec2 uv) {\n vec4 clouds = texture2D(dynSkyCloudBuffer, uv);\n #ifdef DYNSKY_CLOUDS_ENCODED\n clouds.rgb = clouds.rgb / max(1.0 - clouds.rgb, vec3(1e-4)) * dynSkyCloudScale;\n #endif\n return clouds;\n }\n\n // the clouds in a sky direction, from the texture they were rendered to - the direction is\n // projected the way the pass rendering it derives the direction of each texel. The texture\n // is blurred over 3x3 of its texels, removing the grain of the jitter of the steps: each of\n // the 4 bilinear taps, 2/3 of a texel from the center, weighs 3 texels on each axis evenly\n vec4 dynamicSkyCloudsBuffer(vec3 viewDir) {\n vec3 v = dynSkyBufferMatrix * viewDir;\n vec2 ndc = (v.xy / max(-v.z, 1e-6)) * dynSkyBufferProj;\n vec2 uv = ndc * 0.5 + 0.5;\n #ifdef WEBGPU\n uv.y = 1.0 - uv.y;\n #endif\n vec2 offset = (2.0 / 3.0) / vec2(textureSize(dynSkyCloudBuffer, 0));\n return 0.25 * (\n dynamicSkyCloudsTap(uv + vec2(-offset.x, -offset.y)) +\n dynamicSkyCloudsTap(uv + vec2(offset.x, -offset.y)) +\n dynamicSkyCloudsTap(uv + vec2(-offset.x, offset.y)) +\n dynamicSkyCloudsTap(uv + vec2(offset.x, offset.y))\n );\n }\n #endif\n\n void main(void) {\n #ifdef PREPASS_PASS\n gl_FragColor = float2vec4(vLinearDepth);\n #else\n // the sky space flips X, matching how the engine samples the environment\n vec3 dir = normalize(vViewDir);\n dir.x *= -1.0;\n\n vec3 ambient;\n vec3 linear = dynamicSkyBase(dir, ambient);\n\n // the lights of the sky - the sun disc, and at night the stars and the moon. The branch\n // is the same for all the pixels\n vec3 lights = dynSkySunDisc * (1.0 - dynSkyNightBlend);\n if (dynSkyNightBlend > 0.0) {\n lights += dynamicSkyNightLights(dir) * dynSkyNightBlend;\n }\n\n // the clouds over the sky and its lights\n #if defined(DYNSKY_CLOUDS_BUFFER)\n linear = dynamicSkyCompositeClouds(linear, lights, dynamicSkyCloudsBuffer(vViewDir), dir);\n #elif defined(DYNSKY_CLOUDS_FLAT)\n linear = dynamicSkyCompositeClouds(linear, lights, dynamicSkyCloudsFlat(dir, ambient), dir);\n #elif defined(DYNSKY_CLOUDS_VOLUMETRIC)\n linear = dynamicSkyCompositeClouds(linear, lights, dynamicSkyCloudsVolumetric(dir, ambient), dir);\n #else\n linear += lights;\n #endif\n\n // Clamp the sun disc to a value the bloom can handle. The WebGPU bloom down/upsample\n // shaders sum 4 neighbor taps in f16 (half) before scaling, and accumulate mip levels\n // additively - so a very bright pixel overflows those intermediate f16 sums (max 65504)\n // to Inf/NaN and corrupts the whole screen. 6000 keeps every intermediate well in range.\n linear = min(linear, vec3(6000.0));\n\n gl_FragColor = vec4(gammaCorrectOutput(toneMap(linear)), 1.0);\n #endif\n }\n"; export default _default;