/**
 * Copyright (c) 2017-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
 *
 * @author Alexander Rose <alexander.rose@weirdbyte.de>
 *
 * adapted from three.js (https://github.com/mrdoob/three.js/)
 * which under the MIT License, Copyright © 2010-2021 three.js authors
 */
export declare const apply_light_color = "\n#ifdef dIgnoreLight\n    gl_FragColor = material;\n#else\n    #ifdef bumpEnabled\n        if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0) {\n            normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);\n        }\n    #endif\n\n    vec4 color = material;\n\n    ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\n    PhysicalMaterial physicalMaterial;\n    physicalMaterial.diffuseColor = color.rgb * (1.0 - metalness);\n    #ifdef enabledFragDepth\n        physicalMaterial.roughness = min(max(roughness, 0.0525), 1.0);\n    #else\n        vec3 dxy = max(abs(dFdx(normal)), abs(dFdy(normal)));\n        float geometryRoughness = max(max(dxy.x, dxy.y), dxy.z);\n        physicalMaterial.roughness = min(max(roughness, 0.0525) + geometryRoughness, 1.0);\n    #endif\n    physicalMaterial.specularColor = mix(vec3(0.04), color.rgb, metalness);\n    physicalMaterial.specularF90 = 1.0;\n\n    GeometricContext geometry;\n    geometry.position = -vViewPosition;\n    geometry.normal = normal;\n    geometry.viewDir = normalize(vViewPosition);\n\n    IncidentLight directLight;\n    #pragma unroll_loop_start\n    for (int i = 0; i < dLightCount; ++i) {\n        directLight.direction = uLightDirection[i];\n        directLight.color = uLightColor[i] * PI; // * PI for punctual light\n        RE_Direct_Physical(directLight, geometry, physicalMaterial, reflectedLight);\n    }\n    #pragma unroll_loop_end\n\n    vec3 irradiance = uAmbientColor * PI; // * PI for punctual light\n    RE_IndirectDiffuse_Physical(irradiance, geometry, physicalMaterial, reflectedLight);\n\n    // indirect specular only metals\n    vec3 radiance = uAmbientColor * metalness;\n    vec3 iblIrradiance = uAmbientColor * metalness;\n    vec3 clearcoatRadiance = vec3(0.0);\n    RE_IndirectSpecular_Physical(radiance, iblIrradiance, clearcoatRadiance, geometry, physicalMaterial, reflectedLight);\n\n    vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n    outgoingLight = clamp(outgoingLight, 0.0, 1.0); // prevents black artifacts on specular highlight with transparent background\n\n    gl_FragColor = vec4(outgoingLight, color.a);\n#endif\n\n#ifdef dXrayShaded\n    gl_FragColor.a *= 1.0 - pow(abs(dot(normal, vec3(0.0, 0.0, 1.0))), uXrayEdgeFalloff);\n#endif\n";
