1import{f as e}from"./math.scalar.functions-Cad0mLhT.js";import{t}from"./shaderStore-1xgJNigV.js";var n=e({lightFragment:()=>a}),r=`lightFragment`,i=`#ifdef LIGHT{X} 2#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X}) 3#else 4vec4 diffuse{X}=light{X}.vLightDiffuse; 5#define CUSTOM_LIGHT{X}_COLOR 6#if defined(PBR) && defined(CLUSTLIGHT{X}) && defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0 7{int sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting( 8lightDataTexture{X}, 9tileMaskTexture{X}, 10light{X}.vLightData, 11ivec2(light{X}.vSliceRanges[sliceIndex]), 12viewDirectionW, 13normalW, 14vPositionW, 15surfaceAlbedo, 16reflectivityOut 17#ifdef IRIDESCENCE 18,iridescenceIntensity 19#endif 20#ifdef SS_TRANSLUCENCY 21,subSurfaceOut 22#endif 23#ifdef SPECULARTERM 24,AARoughnessFactors.x 25#endif 26#ifdef ANISOTROPIC 27,anisotropicOut 28#endif 29#ifdef SHEEN 30,sheenOut 31#endif 32#ifdef CLEARCOAT 33,clearcoatOut 34#endif 35);} 36#elif defined(PBR) 37#ifdef SPOTLIGHT{X} 38preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW); 39#elif defined(POINTLIGHT{X}) 40preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW); 41#elif defined(HEMILIGHT{X}) 42preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW); 43#elif defined(DIRLIGHT{X}) 44preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW); 45#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) 46#if defined(RECTAREALIGHTEMISSIONTEXTURE{X}) 47preInfo=computeAreaPreLightingInfoWithTexture(areaLightsLTC1Sampler,areaLightsLTC2Sampler,rectAreaLightEmissionTexture{X},viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness); 48#else 49preInfo=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness); 50#endif 51#endif 52preInfo.NdotV=NdotV; 53#ifdef SPOTLIGHT{X} 54#ifdef LIGHT_FALLOFF_GLTF{X} 55preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y); 56#ifdef IESLIGHTTEXTURE{X} 57preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X}); 58#else 59preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); 60#endif 61#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) 62preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared); 63#ifdef IESLIGHTTEXTURE{X} 64preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X}); 65#else 66preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w); 67#endif 68#elif defined(LIGHT_FALLOFF_STANDARD{X}) 69preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x); 70#ifdef IESLIGHTTEXTURE{X} 71preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X}); 72#else 73preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w); 74#endif 75#else 76preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); 77#ifdef IESLIGHTTEXTURE{X} 78preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X}); 79#else 80preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w); 81#endif 82#endif 83#elif defined(POINTLIGHT{X}) 84#ifdef LIGHT_FALLOFF_GLTF{X} 85preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y); 86#elif defined(LIGHT_FALLOFF_PHYSICAL{X}) 87preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared); 88#elif defined(LIGHT_FALLOFF_STANDARD{X}) 89preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x); 90#else 91preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y); 92#endif 93#else 94preInfo.attenuation=1.0; 95#endif
96#if defined(HEMILIGHT{X}) 97preInfo.roughness=roughness; 98#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) 99preInfo.roughness=roughness; 100#else 101preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance); 102#endif 103preInfo.diffuseRoughness=diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo; 104#ifdef IRIDESCENCE 105preInfo.iridescenceIntensity=iridescenceIntensity; 106#endif 107#ifdef SS_TRANSLUCENCY 108info.diffuseTransmission=vec3(0.0); 109#endif 110#ifdef HEMILIGHT{X} 111info.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround); 112#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) 113info.diffuse=computeAreaDiffuseLighting(preInfo,diffuse{X}.rgb); 114#elif defined(SS_TRANSLUCENCY) 115#ifndef SS_TRANSLUCENCY_LEGACY 116info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance); 117#else 118info.diffuse=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance); 119#endif 120#else 121info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb); 122#endif 123#ifdef SPECULARTERM 124#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) 125info.specular=computeAreaSpecularLighting(preInfo,light{X}.vLightSpecular.rgb,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90); 126#else 127#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR) 128{vec3 metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);vec3 dielectricFresnel=fresnelSchlickGGX(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);} 129#else 130coloredFresnel=fresnelSchlickGGX(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90); 131#endif 132#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION 133{float NdotH=dot(normalW,preInfo.H);vec3 fresnel=fresnelSchlickGGX(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);} 134#endif 135#ifdef ANISOTROPIC 136info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb); 137#else 138info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,coloredFresnel,AARoughnessFactors.x,diffuse{X}.rgb); 139#endif 140#endif 141#endif 142#ifndef AREALIGHT{X} 143#ifdef SHEEN 144#ifdef SHEEN_LINKWITHALBEDO 145preInfo.roughness=sheenOut.sheenIntensity; 146#else 147#ifdef HEMILIGHT{X} 148preInfo.roughness=sheenOut.sheenRoughness; 149#else 150preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance); 151#endif 152#endif 153info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb); 154#endif 155#ifdef CLEARCOAT 156#ifdef HEMILIGHT{X} 157preInfo.roughness=clearcoatOut.clearCoatRoughness; 158#else 159preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance); 160#endif 161info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb); 162#ifdef CLEARCOAT_TINT 163absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption; 164#ifdef SS_TRANSLUCENCY 165info.diffuseTransmission*=absorption; 166#endif 167#ifdef SPECULARTERM 168info.specular*=absorption; 169#endif 170#endif 171info.diffuse*=info.clearCoat.w; 172#ifdef SS_TRANSLUCENCY 173info.diffuseTransmission*=info.clearCoat.w; 174#endif 175#ifdef SPECULARTERM 176info.specular*=info.clearCoat.w; 177#endif 178#ifdef SHEEN 179info.sheen*=info.clearCoat.w; 180#endif 181#endif 182#endif 183#else 184#ifdef SPOTLIGHT{X} 185#ifdef IESLIGHTTEXTURE{X} 186info=computeIESSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness,iesLightTexture{X}); 187#else 188info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness); 189#endif
190#elif defined(HEMILIGHT{X}) 191info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness); 192#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X}) 193info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness); 194#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED) 195#if defined(RECTAREALIGHTEMISSIONTEXTURE{X}) 196info=computeAreaLightingWithTexture(areaLightsLTC1Sampler,areaLightsLTC2Sampler,rectAreaLightEmissionTexture{X},viewDirectionW,normalW,vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.rgb,light{X}.vLightHeight.rgb,diffuse{X}.rgb,light{X}.vLightSpecular.rgb, 197#ifdef AREALIGHTNOROUGHTNESS 1980.5 199#else 200vReflectionInfos.y 201#endif 202#else 203info=computeAreaLighting(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.rgb,light{X}.vLightHeight.rgb,diffuse{X}.rgb,light{X}.vLightSpecular.rgb, 204#ifdef AREALIGHTNOROUGHTNESS 2050.5 206#else 207vReflectionInfos.y 208#endif 209#endif 210); 211#elif defined(CLUSTLIGHT{X}) && CLUSTLIGHT_BATCH>0 212{int sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting(lightDataTexture{X},tileMaskTexture{X},viewDirectionW,normalW,light{X}.vLightData,ivec2(light{X}.vSliceRanges[sliceIndex]),glossiness);} 213#endif 214#endif 215#ifdef PROJECTEDLIGHTTEXTURE{X} 216info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},textureProjectionMatrix{X},vPositionW); 217#endif 218#endif 219#ifdef SHADOW{X} 220#ifdef SHADOWCSM{X} 221for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) 222{ 223#ifdef SHADOWCSM_RIGHTHANDED{X} 224diff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z; 225#else 226diff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z; 227#endif 228if (diff{X}>=0.) {index{X}=i;break;}} 229#ifdef SHADOWCSMUSESHADOWMAXZ{X} 230if (index{X}>=0) 231#endif 232{ 233#if defined(SHADOWPCF{X}) 234#if defined(SHADOWLOWQUALITY{X}) 235shadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 236#elif defined(SHADOWMEDIUMQUALITY{X}) 237shadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 238#else 239shadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 240#endif 241#elif defined(SHADOWPCSS{X}) 242#if defined(SHADOWLOWQUALITY{X}) 243shadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); 244#elif defined(SHADOWMEDIUMQUALITY{X}) 245shadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); 246#else 247shadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); 248#endif 249#else 250shadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 251#endif 252#ifdef SHADOWCSMDEBUG{X} 253shadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}]; 254#endif 255#ifndef SHADOWCSMNOBLEND{X} 256float frustumLength=frustumLengths{X}[index{X}];float diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.) 257{index{X}+=1;float nextShadow=0.; 258#if defined(SHADOWPCF{X}) 259#if defined(SHADOWLOWQUALITY{X}) 260nextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 261#elif defined(SHADOWMEDIUMQUALITY{X}) 262nextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 263#else 264nextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 265#endif 266#elif defined(SHADOWPCSS{X}) 267#if defined(SHADOWLOWQUALITY{X}) 268nextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); 269#elif defined(SHADOWMEDIUMQUALITY{X}) 270nextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); 271#else 272nextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X}); 273#endif 274#else 275nextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 276#endif
277shadow=mix(nextShadow,shadow,diffRatio); 278#ifdef SHADOWCSMDEBUG{X} 279shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio); 280#endif 281} 282#endif 283} 284#elif defined(SHADOWCLOSEESM{X}) 285#if defined(SHADOWCUBE{X}) 286shadow=computeShadowWithCloseESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues); 287#else 288shadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w); 289#endif 290#elif defined(SHADOWESM{X}) 291#if defined(SHADOWCUBE{X}) 292shadow=computeShadowWithESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues); 293#else 294shadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w); 295#endif 296#elif defined(SHADOWPOISSON{X}) 297#if defined(SHADOWCUBE{X}) 298shadow=computeShadowWithPoissonSamplingCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues); 299#else 300shadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 301#endif 302#elif defined(SHADOWPCF{X}) 303#if defined(SHADOWLOWQUALITY{X}) 304shadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 305#elif defined(SHADOWMEDIUMQUALITY{X}) 306shadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 307#else 308shadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 309#endif 310#elif defined(SHADOWPCSS{X}) 311#if defined(SHADOWLOWQUALITY{X}) 312shadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 313#elif defined(SHADOWMEDIUMQUALITY{X}) 314shadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 315#else 316shadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 317#endif 318#else 319#if defined(SHADOWCUBE{X}) 320shadow=computeShadowCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.depthValues); 321#else 322shadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w); 323#endif 324#endif 325#ifdef SHADOWONLY 326#ifndef SHADOWINUSE 327#define SHADOWINUSE 328#endif 329globalShadow+=shadow;shadowLightCount+=1.0; 330#endif 331#else 332shadow=1.; 333#endif 334aggShadow+=shadow;numLights+=1.0; 335#ifndef SHADOWONLY 336#ifdef CUSTOMUSERLIGHTING 337diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow); 338#ifdef SPECULARTERM 339specularBase+=computeCustomSpecularLighting(info,specularBase,shadow); 340#endif 341#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) 342diffuseBase+=lightmapColor.rgb*shadow; 343#ifdef SPECULARTERM 344#ifndef LIGHTMAPNOSPECULAR{X} 345specularBase+=info.specular*shadow*lightmapColor.rgb; 346#endif 347#endif 348#ifdef CLEARCOAT 349#ifndef LIGHTMAPNOSPECULAR{X} 350clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb; 351#endif 352#endif 353#ifdef SHEEN 354#ifndef LIGHTMAPNOSPECULAR{X} 355sheenBase+=info.sheen.rgb*shadow; 356#endif 357#endif 358#else 359#ifdef SHADOWCSMDEBUG{X} 360diffuseBase+=info.diffuse*shadowDebug{X}; 361#else 362diffuseBase+=info.diffuse*shadow; 363#endif 364#ifdef SS_TRANSLUCENCY 365diffuseTransmissionBase+=info.diffuseTransmission*shadow; 366#endif 367#ifdef SPECULARTERM 368specularBase+=info.specular*shadow; 369#endif 370#ifdef CLEARCOAT 371clearCoatBase+=info.clearCoat.rgb*shadow; 372#endif 373#ifdef SHEEN 374sheenBase+=info.sheen.rgb*shadow; 375#endif 376#endif 377#endif 378#endif 379`;t.IncludesShadersStore[r]||(t.IncludesShadersStore[r]=i);var a={name:r,shader:i};export{n as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.