declare const _default: "\n uniform vec3 dynSkySunDir; // direction toward the sun\n uniform vec3 dynSkyBetaR; // rayleigh scattering coefficient\n uniform vec3 dynSkyBetaM; // mie scattering coefficient\n uniform float dynSkySunE; // sun intensity\n uniform float dynSkyMieG; // mie directional anisotropy\n uniform float dynSkyLuminance; // scale of the sky radiance\n\n uniform float dynSkyNightBlend; // 0 by day, 1 at night\n uniform vec3 dynSkyNightColor; // the color of the night sky, scaled by its brightness\n uniform vec4 dynSkyNightParams; // x: star brightness, y: star density, z: star size, w: twilight glow\n uniform vec3 dynSkyMoonDir; // direction toward the moon\n uniform vec4 dynSkyMoonParams; // xyz: color of the moon disc, scaled by its glow, w: cos of its radius\n\n const float DYNSKY_PI = 3.141592653589793;\n const vec3 DYNSKY_UP = vec3(0.0, 1.0, 0.0);\n const float DYNSKY_RAYLEIGH_ZENITH = 8.4e3;\n const float DYNSKY_MIE_ZENITH = 1.25e3;\n const float DYNSKY_SUN_ANGULAR_COS = 0.999956676; // cos of the radius of the sun disc\n\n float dynSkyRayleighPhase(float cosT) {\n return (3.0 / (16.0 * DYNSKY_PI)) * (1.0 + cosT * cosT);\n }\n\n float dynSkyHgPhase(float cosT, float g) {\n float g2 = g * g;\n float inv = 1.0 / pow(max(1.0 - 2.0 * g * cosT + g2, 0.0), 1.5);\n return (1.0 / (4.0 * DYNSKY_PI)) * ((1.0 - g2) * inv);\n }\n\n // the radiance of the last dynamicSkyDay call, lighting the clouds\n vec3 dynSkyScatter;\n\n // the sun disc of the last dynamicSkyDay call, a light of the sky composited apart from it\n vec3 dynSkySunDisc = vec3(0.0);\n\n // the daytime sky radiance in a direction, without the sun disc - see dynSkySunDisc\n vec3 dynamicSkyDay(vec3 dirIn) {\n vec3 dir = normalize(dirIn);\n vec3 sunDir = normalize(dynSkySunDir);\n\n // the scattering coefficients and the sun intensity are the same for the whole sky, so\n // they are computed on the CPU\n vec3 betaR = dynSkyBetaR;\n vec3 betaM = dynSkyBetaM;\n float sunE = dynSkySunE;\n\n // optical length along the view direction\n float zenithAngle = acos(max(0.0, dot(DYNSKY_UP, dir)));\n float denom = cos(zenithAngle) + 0.15 * pow(max(93.885 - degrees(zenithAngle), 0.0), -1.253);\n float sR = DYNSKY_RAYLEIGH_ZENITH / denom;\n float sM = DYNSKY_MIE_ZENITH / denom;\n\n vec3 Fex = exp(-(betaR * sR + betaM * sM));\n\n // in-scattering\n float cosTheta = dot(dir, sunDir);\n vec3 betaRTheta = betaR * dynSkyRayleighPhase(cosTheta * 0.5 + 0.5);\n vec3 betaMTheta = betaM * dynSkyHgPhase(cosTheta, dynSkyMieG);\n vec3 betaSum = betaR + betaM;\n\n vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / betaSum) * (1.0 - Fex), vec3(1.5));\n Lin *= mix(\n vec3(1.0),\n pow(sunE * ((betaRTheta + betaMTheta) / betaSum) * Fex, vec3(0.5)),\n clamp(pow(1.0 - dot(DYNSKY_UP, sunDir), 5.0), 0.0, 1.0)\n );\n\n // sky base and the sun disc. The disc is returned apart from the sky, so the clouds can\n // block it fully, and the lighting can leave it out: the sun light carries it, and a disc\n // smaller than a texel of the lighting would flicker in and out as the sun moves\n vec3 L0 = vec3(0.1) * Fex;\n float sundisk = smoothstep(DYNSKY_SUN_ANGULAR_COS, DYNSKY_SUN_ANGULAR_COS + 0.00002, cosTheta);\n vec3 disc = sunE * 19000.0 * Fex * sundisk;\n\n dynSkyScatter = ((Lin + L0) * 0.04 + vec3(0.0, 0.0003, 0.00075)) * dynSkyLuminance;\n dynSkySunDisc = disc * (0.04 * dynSkyLuminance);\n return dynSkyScatter;\n }\n\n // the night sky without its lights: a deep gradient, and a warm twilight glow centered on the\n // horizon point below the sun, fading out as the sun sinks well below the horizon\n vec3 dynamicSkyNightBase(vec3 dir) {\n vec3 col = dynSkyNightColor * mix(1.1, 0.4, max(dir.y, 0.0));\n\n vec3 sunH = normalize(vec3(dynSkySunDir.x, 0.0, dynSkySunDir.z) + vec3(1e-5, 0.0, 0.0));\n float toSun = max(dot(dir, sunH), 0.0);\n float belowFade = clamp(1.0 + dynSkySunDir.y * 4.0, 0.0, 1.0);\n col += vec3(1.0, 0.45, 0.15) * (pow(toSun, 5.0) * belowFade * dynSkyNightParams.w);\n return col;\n }\n\n float dynSkyHash13(vec3 p3) {\n p3 = fract(p3 * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n // the lights of the night sky: the stars, and the moon disc. The stars are one candidate per\n // cell of a grid sampled along the view direction, each of a random size and brightness. Their\n // edges, and the edge of the moon, are anti-aliased against the pixel footprint, so they stay\n // stable as the camera rotates\n vec3 dynamicSkyNightLights(vec3 dir) {\n vec3 p = dir * 70.0;\n vec3 cell = floor(p);\n float present = step(1.0 - dynSkyNightParams.y, dynSkyHash13(cell));\n vec3 sp = vec3(0.3) + 0.4 * vec3(dynSkyHash13(cell + 11.0), dynSkyHash13(cell + 23.0), dynSkyHash13(cell + 37.0));\n float sizeRnd = dynSkyHash13(cell + 53.0);\n float radius = mix(0.05, 0.22, sizeRnd * sizeRnd) * dynSkyNightParams.z;\n float d = length(fract(p) - sp);\n float aa = length(fwidth(p)) + 1e-4;\n float star = present * mix(0.3, 1.0, dynSkyHash13(cell + 71.0)) * (1.0 - smoothstep(radius - aa, radius + aa, d));\n vec3 col = vec3(star * dynSkyNightParams.x * smoothstep(0.0, 0.04, dir.y));\n\n float c = dot(dir, normalize(dynSkyMoonDir));\n float aaMoon = max(fwidth(c), 1e-5);\n float disk = smoothstep(dynSkyMoonParams.w - aaMoon, dynSkyMoonParams.w + aaMoon, c);\n col += dynSkyMoonParams.xyz * disk;\n return col;\n }\n\n // the sky radiance in a direction without its lights, blending the day and the night, and the\n // ambient light around it. The branch is the same for all the pixels, so only one model is\n // evaluated, except during the twilight\n vec3 dynamicSkyBase(vec3 dir, out vec3 ambient) {\n float nb = dynSkyNightBlend;\n vec3 nightAmbient = dynSkyNightColor * 0.6;\n vec3 linear;\n if (nb <= 0.0) {\n linear = dynamicSkyDay(dir);\n ambient = dynSkyScatter;\n } else if (nb >= 1.0) {\n linear = dynamicSkyNightBase(dir);\n ambient = nightAmbient;\n } else {\n linear = mix(dynamicSkyDay(dir), dynamicSkyNightBase(dir), nb);\n ambient = mix(dynSkyScatter, nightAmbient, nb);\n }\n return linear;\n }\n\n // the ambient light of the sky in a direction, lighting the clouds\n vec3 dynamicSkyAmbient(vec3 dir) {\n vec3 ambient;\n dynamicSkyBase(dir, ambient);\n return ambient;\n }\n"; export default _default;