| 1 |
#pragma clang diagnostic ignored "-Wmissing-prototypes" |
| 2 |
#pragma clang diagnostic ignored "-Wmissing-braces" |
| 3 |
|
| 4 |
#include <metal_stdlib> |
| 5 |
#include <simd/simd.h> |
| 6 |
|
| 7 |
using namespace metal; |
| 8 |
|
| 9 |
template<typename T, size_t Num> |
| 10 |
struct spvUnsafeArray |
| 11 |
{ |
| 12 |
T elements[Num ? Num : 1]; |
| 13 |
|
| 14 |
thread T& operator [] (size_t pos) thread |
| 15 |
{ |
| 16 |
return elements[pos]; |
| 17 |
} |
| 18 |
constexpr const thread T& operator [] (size_t pos) const thread |
| 19 |
{ |
| 20 |
return elements[pos]; |
| 21 |
} |
| 22 |
|
| 23 |
device T& operator [] (size_t pos) device |
| 24 |
{ |
| 25 |
return elements[pos]; |
| 26 |
} |
| 27 |
constexpr const device T& operator [] (size_t pos) const device |
| 28 |
{ |
| 29 |
return elements[pos]; |
| 30 |
} |
| 31 |
|
| 32 |
constexpr const constant T& operator [] (size_t pos) const constant |
| 33 |
{ |
| 34 |
return elements[pos]; |
| 35 |
} |
| 36 |
|
| 37 |
threadgroup T& operator [] (size_t pos) threadgroup |
| 38 |
{ |
| 39 |
return elements[pos]; |
| 40 |
} |
| 41 |
constexpr const threadgroup T& operator [] (size_t pos) const threadgroup |
| 42 |
{ |
| 43 |
return elements[pos]; |
| 44 |
} |
| 45 |
}; |
| 46 |
|
| 47 |
struct type_View |
| 48 |
{ |
| 49 |
float4x4 View_TranslatedWorldToClip; |
| 50 |
float4x4 View_WorldToClip; |
| 51 |
float4x4 View_TranslatedWorldToView; |
| 52 |
float4x4 View_ViewToTranslatedWorld; |
| 53 |
float4x4 View_TranslatedWorldToCameraView; |
| 54 |
float4x4 View_CameraViewToTranslatedWorld; |
| 55 |
float4x4 View_ViewToClip; |
| 56 |
float4x4 View_ViewToClipNoAA; |
| 57 |
float4x4 View_ClipToView; |
| 58 |
float4x4 View_ClipToTranslatedWorld; |
| 59 |
float4x4 View_SVPositionToTranslatedWorld; |
| 60 |
float4x4 View_ScreenToWorld; |
| 61 |
float4x4 View_ScreenToTranslatedWorld; |
| 62 |
packed_float3 View_ViewForward; |
| 63 |
float PrePadding_View_844; |
| 64 |
packed_float3 View_ViewUp; |
| 65 |
float PrePadding_View_860; |
| 66 |
packed_float3 View_ViewRight; |
| 67 |
float PrePadding_View_876; |
| 68 |
packed_float3 View_HMDViewNoRollUp; |
| 69 |
float PrePadding_View_892; |
| 70 |
packed_float3 View_HMDViewNoRollRight; |
| 71 |
float PrePadding_View_908; |
| 72 |
float4 View_InvDeviceZToWorldZTransform; |
| 73 |
float4 View_ScreenPositionScaleBias; |
| 74 |
packed_float3 View_WorldCameraOrigin; |
| 75 |
float PrePadding_View_956; |
| 76 |
packed_float3 View_TranslatedWorldCameraOrigin; |
| 77 |
float PrePadding_View_972; |
| 78 |
packed_float3 View_WorldViewOrigin; |
| 79 |
float PrePadding_View_988; |
| 80 |
packed_float3 View_PreViewTranslation; |
| 81 |
float PrePadding_View_1004; |
| 82 |
float4x4 View_PrevProjection; |
| 83 |
float4x4 View_PrevViewProj; |
| 84 |
float4x4 View_PrevViewRotationProj; |
| 85 |
float4x4 View_PrevViewToClip; |
| 86 |
float4x4 View_PrevClipToView; |
| 87 |
float4x4 View_PrevTranslatedWorldToClip; |
| 88 |
float4x4 View_PrevTranslatedWorldToView; |
| 89 |
float4x4 View_PrevViewToTranslatedWorld; |
| 90 |
float4x4 View_PrevTranslatedWorldToCameraView; |
| 91 |
float4x4 View_PrevCameraViewToTranslatedWorld; |
| 92 |
packed_float3 View_PrevWorldCameraOrigin; |
| 93 |
float PrePadding_View_1660; |
| 94 |
packed_float3 View_PrevWorldViewOrigin; |
| 95 |
float PrePadding_View_1676; |
| 96 |
packed_float3 View_PrevPreViewTranslation; |
| 97 |
float PrePadding_View_1692; |
| 98 |
float4x4 View_PrevInvViewProj; |
| 99 |
float4x4 View_PrevScreenToTranslatedWorld; |
| 100 |
float4x4 View_ClipToPrevClip; |
| 101 |
float4 View_TemporalAAJitter; |
| 102 |
float4 View_GlobalClippingPlane; |
| 103 |
float2 View_FieldOfViewWideAngles; |
| 104 |
float2 View_PrevFieldOfViewWideAngles; |
| 105 |
float4 View_ViewRectMin; |
| 106 |
float4 View_ViewSizeAndInvSize; |
| 107 |
float4 View_BufferSizeAndInvSize; |
| 108 |
float4 View_BufferBilinearUVMinMax; |
| 109 |
int View_NumSceneColorMSAASamples; |
| 110 |
float View_PreExposure; |
| 111 |
float View_OneOverPreExposure; |
| 112 |
float PrePadding_View_2012; |
| 113 |
float4 View_DiffuseOverrideParameter; |
| 114 |
float4 View_SpecularOverrideParameter; |
| 115 |
float4 View_NormalOverrideParameter; |
| 116 |
float2 View_RoughnessOverrideParameter; |
| 117 |
float View_PrevFrameGameTime; |
| 118 |
float View_PrevFrameRealTime; |
| 119 |
float View_OutOfBoundsMask; |
| 120 |
float PrePadding_View_2084; |
| 121 |
float PrePadding_View_2088; |
| 122 |
float PrePadding_View_2092; |
| 123 |
packed_float3 View_WorldCameraMovementSinceLastFrame; |
| 124 |
float View_CullingSign; |
| 125 |
float View_NearPlane; |
| 126 |
float View_AdaptiveTessellationFactor; |
| 127 |
float View_GameTime; |
| 128 |
float View_RealTime; |
| 129 |
float View_DeltaTime; |
| 130 |
float View_MaterialTextureMipBias; |
| 131 |
float View_MaterialTextureDerivativeMultiply; |
| 132 |
uint View_Random; |
| 133 |
uint View_FrameNumber; |
| 134 |
uint View_StateFrameIndexMod8; |
| 135 |
uint View_StateFrameIndex; |
| 136 |
float View_CameraCut; |
| 137 |
float View_UnlitViewmodeMask; |
| 138 |
float PrePadding_View_2164; |
| 139 |
float PrePadding_View_2168; |
| 140 |
float PrePadding_View_2172; |
| 141 |
float4 View_DirectionalLightColor; |
| 142 |
packed_float3 View_DirectionalLightDirection; |
| 143 |
float PrePadding_View_2204; |
| 144 |
float4 View_TranslucencyLightingVolumeMin[2]; |
| 145 |
float4 View_TranslucencyLightingVolumeInvSize[2]; |
| 146 |
float4 View_TemporalAAParams; |
| 147 |
float4 View_CircleDOFParams; |
| 148 |
float View_DepthOfFieldSensorWidth; |
| 149 |
float View_DepthOfFieldFocalDistance; |
| 150 |
float View_DepthOfFieldScale; |
| 151 |
float View_DepthOfFieldFocalLength; |
| 152 |
float View_DepthOfFieldFocalRegion; |
| 153 |
float View_DepthOfFieldNearTransitionRegion; |
| 154 |
float View_DepthOfFieldFarTransitionRegion; |
| 155 |
float View_MotionBlurNormalizedToPixel; |
| 156 |
float View_bSubsurfacePostprocessEnabled; |
| 157 |
float View_GeneralPurposeTweak; |
| 158 |
float View_DemosaicVposOffset; |
| 159 |
float PrePadding_View_2348; |
| 160 |
packed_float3 View_IndirectLightingColorScale; |
| 161 |
float View_HDR32bppEncodingMode; |
| 162 |
packed_float3 View_AtmosphericFogSunDirection; |
| 163 |
float View_AtmosphericFogSunPower; |
| 164 |
float View_AtmosphericFogPower; |
| 165 |
float View_AtmosphericFogDensityScale; |
| 166 |
float View_AtmosphericFogDensityOffset; |
| 167 |
float View_AtmosphericFogGroundOffset; |
| 168 |
float View_AtmosphericFogDistanceScale; |
| 169 |
float View_AtmosphericFogAltitudeScale; |
| 170 |
float View_AtmosphericFogHeightScaleRayleigh; |
| 171 |
float View_AtmosphericFogStartDistance; |
| 172 |
float View_AtmosphericFogDistanceOffset; |
| 173 |
float View_AtmosphericFogSunDiscScale; |
| 174 |
uint View_AtmosphericFogRenderMask; |
| 175 |
uint View_AtmosphericFogInscatterAltitudeSampleNum; |
| 176 |
float4 View_AtmosphericFogSunColor; |
| 177 |
packed_float3 View_NormalCurvatureToRoughnessScaleBias; |
| 178 |
float View_RenderingReflectionCaptureMask; |
| 179 |
float4 View_AmbientCubemapTint; |
| 180 |
float View_AmbientCubemapIntensity; |
| 181 |
float View_SkyLightParameters; |
| 182 |
float PrePadding_View_2488; |
| 183 |
float PrePadding_View_2492; |
| 184 |
float4 View_SkyLightColor; |
| 185 |
float4 View_SkyIrradianceEnvironmentMap[7]; |
| 186 |
float View_MobilePreviewMode; |
| 187 |
float View_HMDEyePaddingOffset; |
| 188 |
float View_ReflectionCubemapMaxMip; |
| 189 |
float View_ShowDecalsMask; |
| 190 |
uint View_DistanceFieldAOSpecularOcclusionMode; |
| 191 |
float View_IndirectCapsuleSelfShadowingIntensity; |
| 192 |
float PrePadding_View_2648; |
| 193 |
float PrePadding_View_2652; |
| 194 |
packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight; |
| 195 |
int View_StereoPassIndex; |
| 196 |
float4 View_GlobalVolumeCenterAndExtent[4]; |
| 197 |
float4 View_GlobalVolumeWorldToUVAddAndMul[4]; |
| 198 |
float View_GlobalVolumeDimension; |
| 199 |
float View_GlobalVolumeTexelSize; |
| 200 |
float View_MaxGlobalDistance; |
| 201 |
float View_bCheckerboardSubsurfaceProfileRendering; |
| 202 |
packed_float3 View_VolumetricFogInvGridSize; |
| 203 |
float PrePadding_View_2828; |
| 204 |
packed_float3 View_VolumetricFogGridZParams; |
| 205 |
float PrePadding_View_2844; |
| 206 |
float2 View_VolumetricFogSVPosToVolumeUV; |
| 207 |
float View_VolumetricFogMaxDistance; |
| 208 |
float PrePadding_View_2860; |
| 209 |
packed_float3 View_VolumetricLightmapWorldToUVScale; |
| 210 |
float PrePadding_View_2876; |
| 211 |
packed_float3 View_VolumetricLightmapWorldToUVAdd; |
| 212 |
float PrePadding_View_2892; |
| 213 |
packed_float3 View_VolumetricLightmapIndirectionTextureSize; |
| 214 |
float View_VolumetricLightmapBrickSize; |
| 215 |
packed_float3 View_VolumetricLightmapBrickTexelSize; |
| 216 |
float View_StereoIPD; |
| 217 |
float View_IndirectLightingCacheShowFlag; |
| 218 |
float View_EyeToPixelSpreadAngle; |
| 219 |
}; |
| 220 |
|
| 221 |
struct type_MobileBasePass |
| 222 |
{ |
| 223 |
float4 MobileBasePass_Fog_ExponentialFogParameters; |
| 224 |
float4 MobileBasePass_Fog_ExponentialFogParameters2; |
| 225 |
float4 MobileBasePass_Fog_ExponentialFogColorParameter; |
| 226 |
float4 MobileBasePass_Fog_ExponentialFogParameters3; |
| 227 |
float4 MobileBasePass_Fog_InscatteringLightDirection; |
| 228 |
float4 MobileBasePass_Fog_DirectionalInscatteringColor; |
| 229 |
float2 MobileBasePass_Fog_SinCosInscatteringColorCubemapRotation; |
| 230 |
float PrePadding_MobileBasePass_Fog_104; |
| 231 |
float PrePadding_MobileBasePass_Fog_108; |
| 232 |
packed_float3 MobileBasePass_Fog_FogInscatteringTextureParameters; |
| 233 |
float MobileBasePass_Fog_ApplyVolumetricFog; |
| 234 |
float PrePadding_MobileBasePass_PlanarReflection_128; |
| 235 |
float PrePadding_MobileBasePass_PlanarReflection_132; |
| 236 |
float PrePadding_MobileBasePass_PlanarReflection_136; |
| 237 |
float PrePadding_MobileBasePass_PlanarReflection_140; |
| 238 |
float PrePadding_MobileBasePass_PlanarReflection_144; |
| 239 |
float PrePadding_MobileBasePass_PlanarReflection_148; |
| 240 |
float PrePadding_MobileBasePass_PlanarReflection_152; |
| 241 |
float PrePadding_MobileBasePass_PlanarReflection_156; |
| 242 |
float4 MobileBasePass_PlanarReflection_ReflectionPlane; |
| 243 |
float4 MobileBasePass_PlanarReflection_PlanarReflectionOrigin; |
| 244 |
float4 MobileBasePass_PlanarReflection_PlanarReflectionXAxis; |
| 245 |
float4 MobileBasePass_PlanarReflection_PlanarReflectionYAxis; |
| 246 |
float3x4 MobileBasePass_PlanarReflection_InverseTransposeMirrorMatrix; |
| 247 |
packed_float3 MobileBasePass_PlanarReflection_PlanarReflectionParameters; |
| 248 |
float PrePadding_MobileBasePass_PlanarReflection_284; |
| 249 |
float2 MobileBasePass_PlanarReflection_PlanarReflectionParameters2; |
| 250 |
float PrePadding_MobileBasePass_PlanarReflection_296; |
| 251 |
float PrePadding_MobileBasePass_PlanarReflection_300; |
| 252 |
float4x4 MobileBasePass_PlanarReflection_ProjectionWithExtraFOV[2]; |
| 253 |
float4 MobileBasePass_PlanarReflection_PlanarReflectionScreenScaleBias[2]; |
| 254 |
float2 MobileBasePass_PlanarReflection_PlanarReflectionScreenBound; |
| 255 |
uint MobileBasePass_PlanarReflection_bIsStereo; |
| 256 |
}; |
| 257 |
|
| 258 |
struct type_Primitive |
| 259 |
{ |
| 260 |
float4x4 Primitive_LocalToWorld; |
| 261 |
float4 Primitive_InvNonUniformScaleAndDeterminantSign; |
| 262 |
float4 Primitive_ObjectWorldPositionAndRadius; |
| 263 |
float4x4 Primitive_WorldToLocal; |
| 264 |
float4x4 Primitive_PreviousLocalToWorld; |
| 265 |
float4x4 Primitive_PreviousWorldToLocal; |
| 266 |
packed_float3 Primitive_ActorWorldPosition; |
| 267 |
float Primitive_UseSingleSampleShadowFromStationaryLights; |
| 268 |
packed_float3 Primitive_ObjectBounds; |
| 269 |
float Primitive_LpvBiasMultiplier; |
| 270 |
float Primitive_DecalReceiverMask; |
| 271 |
float Primitive_PerObjectGBufferData; |
| 272 |
float Primitive_UseVolumetricLightmapShadowFromStationaryLights; |
| 273 |
float Primitive_UseEditorDepthTest; |
| 274 |
float4 Primitive_ObjectOrientation; |
| 275 |
float4 Primitive_NonUniformScale; |
| 276 |
packed_float3 Primitive_LocalObjectBoundsMin; |
| 277 |
float PrePadding_Primitive_380; |
| 278 |
packed_float3 Primitive_LocalObjectBoundsMax; |
| 279 |
uint Primitive_LightingChannelMask; |
| 280 |
uint Primitive_LightmapDataIndex; |
| 281 |
int Primitive_SingleCaptureIndex; |
| 282 |
}; |
| 283 |
|
| 284 |
struct type_LandscapeParameters |
| 285 |
{ |
| 286 |
float4 LandscapeParameters_HeightmapUVScaleBias; |
| 287 |
float4 LandscapeParameters_WeightmapUVScaleBias; |
| 288 |
float4 LandscapeParameters_LandscapeLightmapScaleBias; |
| 289 |
float4 LandscapeParameters_SubsectionSizeVertsLayerUVPan; |
| 290 |
float4 LandscapeParameters_SubsectionOffsetParams; |
| 291 |
float4 LandscapeParameters_LightmapSubsectionOffsetParams; |
| 292 |
float4x4 LandscapeParameters_LocalToWorldNoScaling; |
| 293 |
}; |
| 294 |
|
| 295 |
struct type_Globals |
| 296 |
{ |
| 297 |
float4 LodBias; |
| 298 |
float4 LodValues; |
| 299 |
float4 SectionLods; |
| 300 |
float4 NeighborSectionLod[4]; |
| 301 |
}; |
| 302 |
|
| 303 |
struct main0_out |
| 304 |
{ |
| 305 |
float2 out_var_TEXCOORD0 [[user(locn0)]]; |
| 306 |
float2 out_var_TEXCOORD1 [[user(locn1)]]; |
| 307 |
float4 out_var_TEXCOORD2 [[user(locn2)]]; |
| 308 |
float4 out_var_TEXCOORD3 [[user(locn3)]]; |
| 309 |
float4 out_var_TEXCOORD8 [[user(locn4)]]; |
| 310 |
float4 gl_Position [[position]]; |
| 311 |
}; |
| 312 |
|
| 313 |
struct main0_in |
| 314 |
{ |
| 315 |
float4 in_var_ATTRIBUTE0 [[attribute(0)]]; |
| 316 |
float4 in_var_ATTRIBUTE1_0 [[attribute(1)]]; |
| 317 |
float4 in_var_ATTRIBUTE1_1 [[attribute(2)]]; |
| 318 |
}; |
| 319 |
|
| 320 |
vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_MobileBasePass& MobileBasePass [[buffer(1)]], constant type_Primitive& Primitive [[buffer(2)]], constant type_LandscapeParameters& LandscapeParameters [[buffer(3)]], constant type_Globals& _Globals [[buffer(4)]]) |
| 321 |
{ |
| 322 |
main0_out out = {}; |
| 323 |
spvUnsafeArray<float4, 2> in_var_ATTRIBUTE1 = {}; |
| 324 |
in_var_ATTRIBUTE1[0] = in.in_var_ATTRIBUTE1_0; |
| 325 |
in_var_ATTRIBUTE1[1] = in.in_var_ATTRIBUTE1_1; |
| 326 |
spvUnsafeArray<float4, 1> _97; |
| 327 |
for (int _107 = 0; _107 < 1; ) |
| 328 |
{ |
| 329 |
_97[_107] = float4(0.0); |
| 330 |
_107++; |
| 331 |
continue; |
| 332 |
} |
| 333 |
float4 _115 = in.in_var_ATTRIBUTE0 * float4(255.0); |
| 334 |
float2 _116 = _115.zw; |
| 335 |
float2 _119 = fract(_116 * float2(0.5)) * float2(2.0); |
| 336 |
float2 _121 = (_116 - _119) * float2(0.0039215688593685626983642578125); |
| 337 |
float2 _122 = _115.xy; |
| 338 |
float2 _126 = _122 * float2(_Globals.LodValues.w); |
| 339 |
float _127 = _126.y; |
| 340 |
float _128 = _126.x; |
| 341 |
float4 _132 = float4(_127, _128, 1.0 - _128, 1.0 - _127) * float4(2.0); |
| 342 |
float4 _186; |
| 343 |
if (_119.y > 0.5) |
| 344 |
{ |
| 345 |
float4 _161; |
| 346 |
if (_119.x > 0.5) |
| 347 |
{ |
| 348 |
_161 = (_132 * float4(_Globals.SectionLods.w)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[3]); |
| 349 |
} |
| 350 |
else |
| 351 |
{ |
| 352 |
_161 = (_132 * float4(_Globals.SectionLods.z)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[2]); |
| 353 |
} |
| 354 |
_186 = _161; |
| 355 |
} |
| 356 |
else |
| 357 |
{ |
| 358 |
float4 _185; |
| 359 |
if (_119.x > 0.5) |
| 360 |
{ |
| 361 |
_185 = (_132 * float4(_Globals.SectionLods.y)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[1]); |
| 362 |
} |
| 363 |
else |
| 364 |
{ |
| 365 |
_185 = (_132 * float4(_Globals.SectionLods.x)) + ((float4(1.0) - _132) * _Globals.NeighborSectionLod[0]); |
| 366 |
} |
| 367 |
_186 = _185; |
| 368 |
} |
| 369 |
float _206; |
| 370 |
if ((_128 + _127) > 1.0) |
| 371 |
{ |
| 372 |
float _198; |
| 373 |
if (_128 < _127) |
| 374 |
{ |
| 375 |
_198 = _186.w; |
| 376 |
} |
| 377 |
else |
| 378 |
{ |
| 379 |
_198 = _186.z; |
| 380 |
} |
| 381 |
_206 = _198; |
| 382 |
} |
| 383 |
else |
| 384 |
{ |
| 385 |
float _205; |
| 386 |
if (_128 < _127) |
| 387 |
{ |
| 388 |
_205 = _186.y; |
| 389 |
} |
| 390 |
else |
| 391 |
{ |
| 392 |
_205 = _186.x; |
| 393 |
} |
| 394 |
_206 = _205; |
| 395 |
} |
| 396 |
float _207 = floor(_206); |
| 397 |
float _220 = _121.x; |
| 398 |
float3 _235 = select(select(select(select(select(float3(0.03125, _121.yy), float3(0.0625, _220, _121.y), bool3(_207 < 5.0)), float3(0.125, in_var_ATTRIBUTE1[1].w, _220), bool3(_207 < 4.0)), float3(0.25, in_var_ATTRIBUTE1[1].zw), bool3(_207 < 3.0)), float3(0.5, in_var_ATTRIBUTE1[1].yz), bool3(_207 < 2.0)), float3(1.0, in_var_ATTRIBUTE1[1].xy), bool3(_207 < 1.0)); |
| 399 |
float _236 = _235.x; |
| 400 |
float _245 = (((in_var_ATTRIBUTE1[0].x * 65280.0) + (in_var_ATTRIBUTE1[0].y * 255.0)) - 32768.0) * 0.0078125; |
| 401 |
float _252 = (((in_var_ATTRIBUTE1[0].z * 65280.0) + (in_var_ATTRIBUTE1[0].w * 255.0)) - 32768.0) * 0.0078125; |
| 402 |
float2 _257 = floor(_122 * float2(_236)); |
| 403 |
float2 _271 = float2((LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.x * _236) - 1.0, fast::max((LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.x * 0.5) * _236, 2.0) - 1.0) * float2(LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.y); |
| 404 |
float3 _287 = mix(float3(_257 / float2(_271.x), mix(_245, _252, _235.y)), float3(floor(_257 * float2(0.5)) / float2(_271.y), mix(_245, _252, _235.z)), float3(_206 - _207)); |
| 405 |
float2 _288 = _119.xy; |
| 406 |
float2 _292 = _288 * LandscapeParameters.LandscapeParameters_SubsectionOffsetParams.ww; |
| 407 |
float3 _296 = _287 + float3(_292, 0.0); |
| 408 |
float4 _322 = float4((((Primitive.Primitive_LocalToWorld[0u].xyz * _296.xxx) + (Primitive.Primitive_LocalToWorld[1u].xyz * _296.yyy)) + (Primitive.Primitive_LocalToWorld[2u].xyz * _296.zzz)) + (Primitive.Primitive_LocalToWorld[3u].xyz + float3(View.View_PreViewTranslation)), 1.0); |
| 409 |
float2 _323 = _287.xy; |
| 410 |
float4 _338 = float4(_322.x, _322.y, _322.z, _322.w); |
| 411 |
float4 _339 = View.View_TranslatedWorldToClip * _338; |
| 412 |
float3 _341 = _322.xyz - float3(View.View_TranslatedWorldCameraOrigin); |
| 413 |
float _345 = dot(_341, _341); |
| 414 |
float _346 = rsqrt(_345); |
| 415 |
float _347 = _345 * _346; |
| 416 |
float _354 = _341.z; |
| 417 |
float _357 = fast::max(0.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.w); |
| 418 |
float _393; |
| 419 |
float _394; |
| 420 |
float _395; |
| 421 |
float _396; |
| 422 |
if (_357 > 0.0) |
| 423 |
{ |
| 424 |
float _361 = _357 * _346; |
| 425 |
float _362 = _361 * _354; |
| 426 |
float _365 = View.View_WorldCameraOrigin[2] + _362; |
| 427 |
_393 = (1.0 - _361) * _347; |
| 428 |
_394 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.z * exp2(-fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.y * (_365 - MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.w))); |
| 429 |
_395 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.x * exp2(-fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.y * (_365 - MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.y))); |
| 430 |
_396 = _354 - _362; |
| 431 |
} |
| 432 |
else |
| 433 |
{ |
| 434 |
_393 = _347; |
| 435 |
_394 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.x; |
| 436 |
_395 = MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.x; |
| 437 |
_396 = _354; |
| 438 |
} |
| 439 |
float _400 = fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters.y * _396); |
| 440 |
float _405 = log(2.0); |
| 441 |
float _407 = 0.5 * (_405 * _405); |
| 442 |
float _417 = fast::max(-127.0, MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters2.y * _396); |
| 443 |
float _428 = (_395 * ((abs(_400) > 0.00999999977648258209228515625) ? ((1.0 - exp2(-_400)) / _400) : (_405 - (_407 * _400)))) + (_394 * ((abs(_417) > 0.00999999977648258209228515625) ? ((1.0 - exp2(-_417)) / _417) : (_405 - (_407 * _417)))); |
| 444 |
float3 _459; |
| 445 |
if (MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w >= 0.0) |
| 446 |
{ |
| 447 |
_459 = (MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.xyz * float3(pow(fast::clamp(dot(_341 * float3(_346), MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.xyz), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.w))) * float3(1.0 - fast::clamp(exp2(-(_428 * fast::max(_393 - MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w, 0.0))), 0.0, 1.0)); |
| 448 |
} |
| 449 |
else |
| 450 |
{ |
| 451 |
_459 = float3(0.0); |
| 452 |
} |
| 453 |
bool _468 = (MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w > 0.0) && (_347 > MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w); |
| 454 |
float _471 = _468 ? 1.0 : fast::max(fast::clamp(exp2(-(_428 * _393)), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.w); |
| 455 |
_97[0] = float4((MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.xyz * float3(1.0 - _471)) + select(_459, float3(0.0), bool3(_468)), _471); |
| 456 |
float4 _482 = _338; |
| 457 |
_482.w = _339.w; |
| 458 |
out.out_var_TEXCOORD0 = ((_323 + LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.zw) + _292).xy; |
| 459 |
out.out_var_TEXCOORD1 = ((_323 * LandscapeParameters.LandscapeParameters_WeightmapUVScaleBias.xy) + LandscapeParameters.LandscapeParameters_WeightmapUVScaleBias.zw) + (_288 * LandscapeParameters.LandscapeParameters_SubsectionOffsetParams.zz); |
| 460 |
out.out_var_TEXCOORD2 = float4(float4(0.0).x, float4(0.0).y, _97[0].x, _97[0].y); |
| 461 |
out.out_var_TEXCOORD3 = float4(float4(0.0).x, float4(0.0).y, _97[0].z, _97[0].w); |
| 462 |
out.out_var_TEXCOORD8 = _482; |
| 463 |
out.gl_Position = _339; |
| 464 |
return out; |
| 465 |
} |
| 466 |
|