|
| 1 | +#include <metal_stdlib> |
| 2 | +#include <simd/simd.h> |
| 3 | + |
| 4 | +using namespace metal; |
| 5 | + |
| 6 | +struct type_View |
| 7 | +{ |
| 8 | + float4x4 View_TranslatedWorldToClip; |
| 9 | + float4x4 View_WorldToClip; |
| 10 | + float4x4 View_TranslatedWorldToView; |
| 11 | + float4x4 View_ViewToTranslatedWorld; |
| 12 | + float4x4 View_TranslatedWorldToCameraView; |
| 13 | + float4x4 View_CameraViewToTranslatedWorld; |
| 14 | + float4x4 View_ViewToClip; |
| 15 | + float4x4 View_ViewToClipNoAA; |
| 16 | + float4x4 View_ClipToView; |
| 17 | + float4x4 View_ClipToTranslatedWorld; |
| 18 | + float4x4 View_SVPositionToTranslatedWorld; |
| 19 | + float4x4 View_ScreenToWorld; |
| 20 | + float4x4 View_ScreenToTranslatedWorld; |
| 21 | + packed_float3 View_ViewForward; |
| 22 | + float PrePadding_View_844; |
| 23 | + packed_float3 View_ViewUp; |
| 24 | + float PrePadding_View_860; |
| 25 | + packed_float3 View_ViewRight; |
| 26 | + float PrePadding_View_876; |
| 27 | + packed_float3 View_HMDViewNoRollUp; |
| 28 | + float PrePadding_View_892; |
| 29 | + packed_float3 View_HMDViewNoRollRight; |
| 30 | + float PrePadding_View_908; |
| 31 | + float4 View_InvDeviceZToWorldZTransform; |
| 32 | + float4 View_ScreenPositionScaleBias; |
| 33 | + packed_float3 View_WorldCameraOrigin; |
| 34 | + float PrePadding_View_956; |
| 35 | + packed_float3 View_TranslatedWorldCameraOrigin; |
| 36 | + float PrePadding_View_972; |
| 37 | + packed_float3 View_WorldViewOrigin; |
| 38 | + float PrePadding_View_988; |
| 39 | + packed_float3 View_PreViewTranslation; |
| 40 | + float PrePadding_View_1004; |
| 41 | + float4x4 View_PrevProjection; |
| 42 | + float4x4 View_PrevViewProj; |
| 43 | + float4x4 View_PrevViewRotationProj; |
| 44 | + float4x4 View_PrevViewToClip; |
| 45 | + float4x4 View_PrevClipToView; |
| 46 | + float4x4 View_PrevTranslatedWorldToClip; |
| 47 | + float4x4 View_PrevTranslatedWorldToView; |
| 48 | + float4x4 View_PrevViewToTranslatedWorld; |
| 49 | + float4x4 View_PrevTranslatedWorldToCameraView; |
| 50 | + float4x4 View_PrevCameraViewToTranslatedWorld; |
| 51 | + packed_float3 View_PrevWorldCameraOrigin; |
| 52 | + float PrePadding_View_1660; |
| 53 | + packed_float3 View_PrevWorldViewOrigin; |
| 54 | + float PrePadding_View_1676; |
| 55 | + packed_float3 View_PrevPreViewTranslation; |
| 56 | + float PrePadding_View_1692; |
| 57 | + float4x4 View_PrevInvViewProj; |
| 58 | + float4x4 View_PrevScreenToTranslatedWorld; |
| 59 | + float4x4 View_ClipToPrevClip; |
| 60 | + float4 View_TemporalAAJitter; |
| 61 | + float4 View_GlobalClippingPlane; |
| 62 | + float2 View_FieldOfViewWideAngles; |
| 63 | + float2 View_PrevFieldOfViewWideAngles; |
| 64 | + float4 View_ViewRectMin; |
| 65 | + float4 View_ViewSizeAndInvSize; |
| 66 | + float4 View_BufferSizeAndInvSize; |
| 67 | + float4 View_BufferBilinearUVMinMax; |
| 68 | + int View_NumSceneColorMSAASamples; |
| 69 | + float View_PreExposure; |
| 70 | + float View_OneOverPreExposure; |
| 71 | + float PrePadding_View_2012; |
| 72 | + float4 View_DiffuseOverrideParameter; |
| 73 | + float4 View_SpecularOverrideParameter; |
| 74 | + float4 View_NormalOverrideParameter; |
| 75 | + float2 View_RoughnessOverrideParameter; |
| 76 | + float View_PrevFrameGameTime; |
| 77 | + float View_PrevFrameRealTime; |
| 78 | + float View_OutOfBoundsMask; |
| 79 | + float PrePadding_View_2084; |
| 80 | + float PrePadding_View_2088; |
| 81 | + float PrePadding_View_2092; |
| 82 | + packed_float3 View_WorldCameraMovementSinceLastFrame; |
| 83 | + float View_CullingSign; |
| 84 | + float View_NearPlane; |
| 85 | + float View_AdaptiveTessellationFactor; |
| 86 | + float View_GameTime; |
| 87 | + float View_RealTime; |
| 88 | + float View_DeltaTime; |
| 89 | + float View_MaterialTextureMipBias; |
| 90 | + float View_MaterialTextureDerivativeMultiply; |
| 91 | + uint View_Random; |
| 92 | + uint View_FrameNumber; |
| 93 | + uint View_StateFrameIndexMod8; |
| 94 | + uint View_StateFrameIndex; |
| 95 | + float View_CameraCut; |
| 96 | + float View_UnlitViewmodeMask; |
| 97 | + float PrePadding_View_2164; |
| 98 | + float PrePadding_View_2168; |
| 99 | + float PrePadding_View_2172; |
| 100 | + float4 View_DirectionalLightColor; |
| 101 | + packed_float3 View_DirectionalLightDirection; |
| 102 | + float PrePadding_View_2204; |
| 103 | + float4 View_TranslucencyLightingVolumeMin[2]; |
| 104 | + float4 View_TranslucencyLightingVolumeInvSize[2]; |
| 105 | + float4 View_TemporalAAParams; |
| 106 | + float4 View_CircleDOFParams; |
| 107 | + float View_DepthOfFieldSensorWidth; |
| 108 | + float View_DepthOfFieldFocalDistance; |
| 109 | + float View_DepthOfFieldScale; |
| 110 | + float View_DepthOfFieldFocalLength; |
| 111 | + float View_DepthOfFieldFocalRegion; |
| 112 | + float View_DepthOfFieldNearTransitionRegion; |
| 113 | + float View_DepthOfFieldFarTransitionRegion; |
| 114 | + float View_MotionBlurNormalizedToPixel; |
| 115 | + float View_bSubsurfacePostprocessEnabled; |
| 116 | + float View_GeneralPurposeTweak; |
| 117 | + float View_DemosaicVposOffset; |
| 118 | + float PrePadding_View_2348; |
| 119 | + packed_float3 View_IndirectLightingColorScale; |
| 120 | + float View_HDR32bppEncodingMode; |
| 121 | + packed_float3 View_AtmosphericFogSunDirection; |
| 122 | + float View_AtmosphericFogSunPower; |
| 123 | + float View_AtmosphericFogPower; |
| 124 | + float View_AtmosphericFogDensityScale; |
| 125 | + float View_AtmosphericFogDensityOffset; |
| 126 | + float View_AtmosphericFogGroundOffset; |
| 127 | + float View_AtmosphericFogDistanceScale; |
| 128 | + float View_AtmosphericFogAltitudeScale; |
| 129 | + float View_AtmosphericFogHeightScaleRayleigh; |
| 130 | + float View_AtmosphericFogStartDistance; |
| 131 | + float View_AtmosphericFogDistanceOffset; |
| 132 | + float View_AtmosphericFogSunDiscScale; |
| 133 | + uint View_AtmosphericFogRenderMask; |
| 134 | + uint View_AtmosphericFogInscatterAltitudeSampleNum; |
| 135 | + float4 View_AtmosphericFogSunColor; |
| 136 | + packed_float3 View_NormalCurvatureToRoughnessScaleBias; |
| 137 | + float View_RenderingReflectionCaptureMask; |
| 138 | + float4 View_AmbientCubemapTint; |
| 139 | + float View_AmbientCubemapIntensity; |
| 140 | + float View_SkyLightParameters; |
| 141 | + float PrePadding_View_2488; |
| 142 | + float PrePadding_View_2492; |
| 143 | + float4 View_SkyLightColor; |
| 144 | + float4 View_SkyIrradianceEnvironmentMap[7]; |
| 145 | + float View_MobilePreviewMode; |
| 146 | + float View_HMDEyePaddingOffset; |
| 147 | + float View_ReflectionCubemapMaxMip; |
| 148 | + float View_ShowDecalsMask; |
| 149 | + uint View_DistanceFieldAOSpecularOcclusionMode; |
| 150 | + float View_IndirectCapsuleSelfShadowingIntensity; |
| 151 | + float PrePadding_View_2648; |
| 152 | + float PrePadding_View_2652; |
| 153 | + packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight; |
| 154 | + int View_StereoPassIndex; |
| 155 | + float4 View_GlobalVolumeCenterAndExtent[4]; |
| 156 | + float4 View_GlobalVolumeWorldToUVAddAndMul[4]; |
| 157 | + float View_GlobalVolumeDimension; |
| 158 | + float View_GlobalVolumeTexelSize; |
| 159 | + float View_MaxGlobalDistance; |
| 160 | + float View_bCheckerboardSubsurfaceProfileRendering; |
| 161 | + packed_float3 View_VolumetricFogInvGridSize; |
| 162 | + float PrePadding_View_2828; |
| 163 | + packed_float3 View_VolumetricFogGridZParams; |
| 164 | + float PrePadding_View_2844; |
| 165 | + float2 View_VolumetricFogSVPosToVolumeUV; |
| 166 | + float View_VolumetricFogMaxDistance; |
| 167 | + float PrePadding_View_2860; |
| 168 | + packed_float3 View_VolumetricLightmapWorldToUVScale; |
| 169 | + float PrePadding_View_2876; |
| 170 | + packed_float3 View_VolumetricLightmapWorldToUVAdd; |
| 171 | + float PrePadding_View_2892; |
| 172 | + packed_float3 View_VolumetricLightmapIndirectionTextureSize; |
| 173 | + float View_VolumetricLightmapBrickSize; |
| 174 | + packed_float3 View_VolumetricLightmapBrickTexelSize; |
| 175 | + float View_StereoIPD; |
| 176 | + float View_IndirectLightingCacheShowFlag; |
| 177 | + float View_EyeToPixelSpreadAngle; |
| 178 | +}; |
| 179 | + |
| 180 | +struct type_MobileDirectionalLight |
| 181 | +{ |
| 182 | + float4 MobileDirectionalLight_DirectionalLightColor; |
| 183 | + float4 MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition; |
| 184 | + float4 MobileDirectionalLight_DirectionalLightShadowSize; |
| 185 | + float4 MobileDirectionalLight_DirectionalLightDistanceFadeMAD; |
| 186 | + float4 MobileDirectionalLight_DirectionalLightShadowDistances; |
| 187 | + float4x4 MobileDirectionalLight_DirectionalLightScreenToShadow[4]; |
| 188 | +}; |
| 189 | + |
| 190 | +struct type_Globals |
| 191 | +{ |
| 192 | + int NumDynamicPointLights; |
| 193 | + float4 LightPositionAndInvRadius[4]; |
| 194 | + float4 LightColorAndFalloffExponent[4]; |
| 195 | + float4 MobileReflectionParams; |
| 196 | +}; |
| 197 | + |
| 198 | +constant float3 _136 = {}; |
| 199 | +constant float4 _137 = {}; |
| 200 | +constant float _138 = {}; |
| 201 | +constant float3 _573 = {}; |
| 202 | + |
| 203 | +struct main0_out |
| 204 | +{ |
| 205 | + float4 out_var_SV_Target0 [[color(0)]]; |
| 206 | +}; |
| 207 | + |
| 208 | +struct main0_in |
| 209 | +{ |
| 210 | + float2 in_var_TEXCOORD0 [[user(locn0)]]; |
| 211 | + float4 in_var_TEXCOORD7 [[user(locn1)]]; |
| 212 | + float4 in_var_TEXCOORD8 [[user(locn2)]]; |
| 213 | +}; |
| 214 | + |
| 215 | +fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_MobileDirectionalLight& MobileDirectionalLight [[buffer(1)]], constant type_Globals& _Globals [[buffer(2)]], texture2d<float> MobileDirectionalLight_DirectionalLightShadowTexture [[texture(0)]], texture2d<float> Material_Texture2D_0 [[texture(1)]], texture2d<float> Material_Texture2D_1 [[texture(2)]], texturecube<float> ReflectionCubemap [[texture(3)]], sampler MobileDirectionalLight_DirectionalLightShadowSampler [[sampler(0)]], sampler Material_Texture2D_0Sampler [[sampler(1)]], sampler Material_Texture2D_1Sampler [[sampler(2)]], sampler ReflectionCubemapSampler [[sampler(3)]], float4 gl_FragCoord [[position]]) |
| 216 | +{ |
| 217 | + main0_out out = {}; |
| 218 | + float4 _177 = float4((((gl_FragCoord.xy - View.View_ViewRectMin.xy) * View.View_ViewSizeAndInvSize.zw) - float2(0.5)) * float2(2.0, -2.0), _138, 1.0) * float4(gl_FragCoord.w); |
| 219 | + float3 _181 = normalize(-in.in_var_TEXCOORD8.xyz); |
| 220 | + float2 _190 = (Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (in.in_var_TEXCOORD0 * float2(10.0))).xy * float2(2.0)) - float2(1.0); |
| 221 | + float3 _206 = normalize(float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0)) * (((float4(_190, sqrt(fast::clamp(1.0 - dot(_190, _190), 0.0, 1.0)), 1.0).xyz * float3(0.300000011920928955078125, 0.300000011920928955078125, 1.0)) * float3(View.View_NormalOverrideParameter.w)) + View.View_NormalOverrideParameter.xyz)); |
| 222 | + float _208 = dot(_206, _181); |
| 223 | + float _219 = mix(0.4000000059604644775390625, 1.0, Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(20.0))).x); |
| 224 | + float4 _223 = Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(5.0))); |
| 225 | + float _224 = _177.w; |
| 226 | + float _228 = fast::min(fast::max((_224 - 24.0) * 0.000666666659526526927947998046875, 0.0), 1.0); |
| 227 | + float _229 = _223.y; |
| 228 | + float4 _233 = Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(0.5))); |
| 229 | + float _235 = _233.y; |
| 230 | + float _253 = fast::clamp((fast::min(fast::max(mix(0.0, 0.5, _235) + mix(mix(0.699999988079071044921875, 1.0, _229), 1.0, _228), 0.0), 1.0) * View.View_RoughnessOverrideParameter.y) + View.View_RoughnessOverrideParameter.x, 0.119999997317790985107421875, 1.0); |
| 231 | + float2 _257 = (float2(_253) * float2(-1.0, -0.0274999998509883880615234375)) + float2(1.0, 0.0425000004470348358154296875); |
| 232 | + float _258 = _257.x; |
| 233 | + float3 _270 = (fast::clamp(float3(mix(_219, 1.0 - _219, mix(_229, 1.0, _228)) * (mix(0.2949999868869781494140625, 0.660000026226043701171875, mix(_235 + mix(_229, 0.0, _228), 0.5, 0.5)) * 0.5)), float3(0.0), float3(1.0)) * float3(View.View_DiffuseOverrideParameter.w)) + View.View_DiffuseOverrideParameter.xyz; |
| 234 | + float3 _275 = float3(((fast::min(_258 * _258, exp2((-9.27999973297119140625) * fast::max(_208, 0.0))) * _258) + _257.y) * View.View_SpecularOverrideParameter.w) + View.View_SpecularOverrideParameter.xyz; |
| 235 | + float _276 = _275.x; |
| 236 | + float4 _303; |
| 237 | + int _286 = 0; |
| 238 | + for (;;) |
| 239 | + { |
| 240 | + if (_286 < 2) |
| 241 | + { |
| 242 | + if (_224 < MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowDistances[uint(_286)]) |
| 243 | + { |
| 244 | + _303 = MobileDirectionalLight.MobileDirectionalLight_DirectionalLightScreenToShadow[_286] * float4(_177.xy, _224, 1.0); |
| 245 | + break; |
| 246 | + } |
| 247 | + _286++; |
| 248 | + continue; |
| 249 | + } |
| 250 | + else |
| 251 | + { |
| 252 | + _303 = float4(0.0); |
| 253 | + break; |
| 254 | + } |
| 255 | + } |
| 256 | + float _423; |
| 257 | + if (_303.z > 0.0) |
| 258 | + { |
| 259 | + float2 _311 = _303.xy * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.xy; |
| 260 | + float2 _312 = fract(_311); |
| 261 | + float2 _313 = floor(_311); |
| 262 | + float3 _320 = _573; |
| 263 | + _320.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 264 | + float3 _326 = _320; |
| 265 | + _326.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 266 | + float3 _332 = _326; |
| 267 | + _332.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 268 | + float3 _335 = float3(MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.w); |
| 269 | + float3 _337 = float3((fast::min(_303.z, 0.999989986419677734375) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.w) - 1.0); |
| 270 | + float3 _339 = fast::clamp((_332 * _335) - _337, float3(0.0), float3(1.0)); |
| 271 | + float3 _345 = _573; |
| 272 | + _345.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 273 | + float3 _351 = _345; |
| 274 | + _351.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 275 | + float3 _357 = _351; |
| 276 | + _357.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 277 | + float3 _360 = fast::clamp((_357 * _335) - _337, float3(0.0), float3(1.0)); |
| 278 | + float3 _366 = _573; |
| 279 | + _366.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 280 | + float3 _372 = _366; |
| 281 | + _372.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 282 | + float3 _378 = _372; |
| 283 | + _378.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x; |
| 284 | + float3 _381 = fast::clamp((_378 * _335) - _337, float3(0.0), float3(1.0)); |
| 285 | + float _383 = _312.x; |
| 286 | + float _384 = 1.0 - _383; |
| 287 | + float3 _399 = _136; |
| 288 | + _399.x = ((_339.x * _384) + _339.y) + (_339.z * _383); |
| 289 | + float3 _403 = _399; |
| 290 | + _403.y = ((_360.x * _384) + _360.y) + (_360.z * _383); |
| 291 | + float3 _407 = _403; |
| 292 | + _407.z = ((_381.x * _384) + _381.y) + (_381.z * _383); |
| 293 | + float _408 = _312.y; |
| 294 | + float _420 = fast::clamp((_224 * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDistanceFadeMAD.x) + MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDistanceFadeMAD.y, 0.0, 1.0); |
| 295 | + _423 = mix(fast::clamp(0.25 * dot(_407, float3(1.0 - _408, 1.0, _408)), 0.0, 1.0), 1.0, _420 * _420); |
| 296 | + } |
| 297 | + else |
| 298 | + { |
| 299 | + _423 = 1.0; |
| 300 | + } |
| 301 | + float3 _429 = normalize(_181 + MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.xyz); |
| 302 | + float _439 = (_253 * 0.25) + 0.25; |
| 303 | + float3 _440 = cross(_206, _429); |
| 304 | + float _442 = _253 * _253; |
| 305 | + float _443 = fast::max(0.0, dot(_206, _429)) * _442; |
| 306 | + float _446 = _442 / (dot(_440, _440) + (_443 * _443)); |
| 307 | + bool _458 = float(_Globals.MobileReflectionParams.w > 0.0) != 0.0; |
| 308 | + float4 _468 = ReflectionCubemap.sample(ReflectionCubemapSampler, ((-_181) + ((_206 * float3(_208)) * float3(2.0))), level(((_458 ? _Globals.MobileReflectionParams.w : View.View_ReflectionCubemapMaxMip) - 1.0) - (1.0 - (1.2000000476837158203125 * log2(_253))))); |
| 309 | + float3 _481; |
| 310 | + if (_458) |
| 311 | + { |
| 312 | + _481 = _468.xyz * View.View_SkyLightColor.xyz; |
| 313 | + } |
| 314 | + else |
| 315 | + { |
| 316 | + float3 _476 = _468.xyz * float3(_468.w * 16.0); |
| 317 | + _481 = _476 * _476; |
| 318 | + } |
| 319 | + float3 _484 = float3(_276); |
| 320 | + float3 _488; |
| 321 | + _488 = ((float3(_423 * fast::max(0.0, dot(_206, MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.xyz))) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightColor.xyz) * (_270 + float3(_276 * (_439 * fast::min(_446 * _446, 65504.0))))) + (_481 * _484); |
| 322 | + float3 _507; |
| 323 | + float _509; |
| 324 | + float _511; |
| 325 | + float _537; |
| 326 | + int _491 = 0; |
| 327 | + for (;;) |
| 328 | + { |
| 329 | + if (_491 < _Globals.NumDynamicPointLights) |
| 330 | + { |
| 331 | + float3 _501 = _Globals.LightPositionAndInvRadius[_491].xyz - (in.in_var_TEXCOORD8.xyz - float3(View.View_PreViewTranslation)); |
| 332 | + float _502 = dot(_501, _501); |
| 333 | + float3 _505 = _501 * float3(rsqrt(_502)); |
| 334 | + _507 = normalize(_181 + _505); |
| 335 | + _509 = fast::max(0.0, dot(_206, _505)); |
| 336 | + _511 = fast::max(0.0, dot(_206, _507)); |
| 337 | + if (_Globals.LightColorAndFalloffExponent[_491].w == 0.0) |
| 338 | + { |
| 339 | + float _531 = _502 * (_Globals.LightPositionAndInvRadius[_491].w * _Globals.LightPositionAndInvRadius[_491].w); |
| 340 | + float _534 = fast::clamp(1.0 - (_531 * _531), 0.0, 1.0); |
| 341 | + _537 = (1.0 / (_502 + 1.0)) * (_534 * _534); |
| 342 | + } |
| 343 | + else |
| 344 | + { |
| 345 | + float3 _521 = _501 * float3(_Globals.LightPositionAndInvRadius[_491].w); |
| 346 | + _537 = pow(1.0 - fast::clamp(dot(_521, _521), 0.0, 1.0), _Globals.LightColorAndFalloffExponent[_491].w); |
| 347 | + } |
| 348 | + float3 _544 = cross(_206, _507); |
| 349 | + float _546 = _511 * _442; |
| 350 | + float _549 = _442 / (dot(_544, _544) + (_546 * _546)); |
| 351 | + _488 += fast::min(float3(65000.0), ((float3(_537 * _509) * _Globals.LightColorAndFalloffExponent[_491].xyz) * float3(0.3183098733425140380859375)) * (_270 + float3(_276 * (_439 * fast::min(_549 * _549, 65504.0))))); |
| 352 | + _491++; |
| 353 | + continue; |
| 354 | + } |
| 355 | + else |
| 356 | + { |
| 357 | + break; |
| 358 | + } |
| 359 | + } |
| 360 | + float3 _567 = (mix(_488, _270 + _484, float3(View.View_UnlitViewmodeMask)) * float3(in.in_var_TEXCOORD7.w)) + in.in_var_TEXCOORD7.xyz; |
| 361 | + float4 _571 = float4(_567.x, _567.y, _567.z, _137.w); |
| 362 | + _571.w = fast::min(in.in_var_TEXCOORD8.w, 65500.0); |
| 363 | + out.out_var_SV_Target0 = _571; |
| 364 | + return out; |
| 365 | +} |
| 366 | + |
0 commit comments