| 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_ClipToWorld; |
| 52 |
float4x4 View_TranslatedWorldToView; |
| 53 |
float4x4 View_ViewToTranslatedWorld; |
| 54 |
float4x4 View_TranslatedWorldToCameraView; |
| 55 |
float4x4 View_CameraViewToTranslatedWorld; |
| 56 |
float4x4 View_ViewToClip; |
| 57 |
float4x4 View_ViewToClipNoAA; |
| 58 |
float4x4 View_ClipToView; |
| 59 |
float4x4 View_ClipToTranslatedWorld; |
| 60 |
float4x4 View_SVPositionToTranslatedWorld; |
| 61 |
float4x4 View_ScreenToWorld; |
| 62 |
float4x4 View_ScreenToTranslatedWorld; |
| 63 |
packed_float3 View_ViewForward; |
| 64 |
float PrePadding_View_908; |
| 65 |
packed_float3 View_ViewUp; |
| 66 |
float PrePadding_View_924; |
| 67 |
packed_float3 View_ViewRight; |
| 68 |
float PrePadding_View_940; |
| 69 |
packed_float3 View_HMDViewNoRollUp; |
| 70 |
float PrePadding_View_956; |
| 71 |
packed_float3 View_HMDViewNoRollRight; |
| 72 |
float PrePadding_View_972; |
| 73 |
float4 View_InvDeviceZToWorldZTransform; |
| 74 |
float4 View_ScreenPositionScaleBias; |
| 75 |
packed_float3 View_WorldCameraOrigin; |
| 76 |
float PrePadding_View_1020; |
| 77 |
packed_float3 View_TranslatedWorldCameraOrigin; |
| 78 |
float PrePadding_View_1036; |
| 79 |
packed_float3 View_WorldViewOrigin; |
| 80 |
float PrePadding_View_1052; |
| 81 |
packed_float3 View_PreViewTranslation; |
| 82 |
float PrePadding_View_1068; |
| 83 |
float4x4 View_PrevProjection; |
| 84 |
float4x4 View_PrevViewProj; |
| 85 |
float4x4 View_PrevViewRotationProj; |
| 86 |
float4x4 View_PrevViewToClip; |
| 87 |
float4x4 View_PrevClipToView; |
| 88 |
float4x4 View_PrevTranslatedWorldToClip; |
| 89 |
float4x4 View_PrevTranslatedWorldToView; |
| 90 |
float4x4 View_PrevViewToTranslatedWorld; |
| 91 |
float4x4 View_PrevTranslatedWorldToCameraView; |
| 92 |
float4x4 View_PrevCameraViewToTranslatedWorld; |
| 93 |
packed_float3 View_PrevWorldCameraOrigin; |
| 94 |
float PrePadding_View_1724; |
| 95 |
packed_float3 View_PrevWorldViewOrigin; |
| 96 |
float PrePadding_View_1740; |
| 97 |
packed_float3 View_PrevPreViewTranslation; |
| 98 |
float PrePadding_View_1756; |
| 99 |
float4x4 View_PrevInvViewProj; |
| 100 |
float4x4 View_PrevScreenToTranslatedWorld; |
| 101 |
float4x4 View_ClipToPrevClip; |
| 102 |
float4 View_TemporalAAJitter; |
| 103 |
float4 View_GlobalClippingPlane; |
| 104 |
float2 View_FieldOfViewWideAngles; |
| 105 |
float2 View_PrevFieldOfViewWideAngles; |
| 106 |
float4 View_ViewRectMin; |
| 107 |
float4 View_ViewSizeAndInvSize; |
| 108 |
float4 View_BufferSizeAndInvSize; |
| 109 |
float4 View_BufferBilinearUVMinMax; |
| 110 |
int View_NumSceneColorMSAASamples; |
| 111 |
float View_PreExposure; |
| 112 |
float View_OneOverPreExposure; |
| 113 |
float PrePadding_View_2076; |
| 114 |
float4 View_DiffuseOverrideParameter; |
| 115 |
float4 View_SpecularOverrideParameter; |
| 116 |
float4 View_NormalOverrideParameter; |
| 117 |
float2 View_RoughnessOverrideParameter; |
| 118 |
float View_PrevFrameGameTime; |
| 119 |
float View_PrevFrameRealTime; |
| 120 |
float View_OutOfBoundsMask; |
| 121 |
float PrePadding_View_2148; |
| 122 |
float PrePadding_View_2152; |
| 123 |
float PrePadding_View_2156; |
| 124 |
packed_float3 View_WorldCameraMovementSinceLastFrame; |
| 125 |
float View_CullingSign; |
| 126 |
float View_NearPlane; |
| 127 |
float View_AdaptiveTessellationFactor; |
| 128 |
float View_GameTime; |
| 129 |
float View_RealTime; |
| 130 |
float View_DeltaTime; |
| 131 |
float View_MaterialTextureMipBias; |
| 132 |
float View_MaterialTextureDerivativeMultiply; |
| 133 |
uint View_Random; |
| 134 |
uint View_FrameNumber; |
| 135 |
uint View_StateFrameIndexMod8; |
| 136 |
uint View_StateFrameIndex; |
| 137 |
float View_CameraCut; |
| 138 |
float View_UnlitViewmodeMask; |
| 139 |
float PrePadding_View_2228; |
| 140 |
float PrePadding_View_2232; |
| 141 |
float PrePadding_View_2236; |
| 142 |
float4 View_DirectionalLightColor; |
| 143 |
packed_float3 View_DirectionalLightDirection; |
| 144 |
float PrePadding_View_2268; |
| 145 |
float4 View_TranslucencyLightingVolumeMin[2]; |
| 146 |
float4 View_TranslucencyLightingVolumeInvSize[2]; |
| 147 |
float4 View_TemporalAAParams; |
| 148 |
float4 View_CircleDOFParams; |
| 149 |
float View_DepthOfFieldSensorWidth; |
| 150 |
float View_DepthOfFieldFocalDistance; |
| 151 |
float View_DepthOfFieldScale; |
| 152 |
float View_DepthOfFieldFocalLength; |
| 153 |
float View_DepthOfFieldFocalRegion; |
| 154 |
float View_DepthOfFieldNearTransitionRegion; |
| 155 |
float View_DepthOfFieldFarTransitionRegion; |
| 156 |
float View_MotionBlurNormalizedToPixel; |
| 157 |
float View_bSubsurfacePostprocessEnabled; |
| 158 |
float View_GeneralPurposeTweak; |
| 159 |
float View_DemosaicVposOffset; |
| 160 |
float PrePadding_View_2412; |
| 161 |
packed_float3 View_IndirectLightingColorScale; |
| 162 |
float View_HDR32bppEncodingMode; |
| 163 |
packed_float3 View_AtmosphericFogSunDirection; |
| 164 |
float View_AtmosphericFogSunPower; |
| 165 |
float View_AtmosphericFogPower; |
| 166 |
float View_AtmosphericFogDensityScale; |
| 167 |
float View_AtmosphericFogDensityOffset; |
| 168 |
float View_AtmosphericFogGroundOffset; |
| 169 |
float View_AtmosphericFogDistanceScale; |
| 170 |
float View_AtmosphericFogAltitudeScale; |
| 171 |
float View_AtmosphericFogHeightScaleRayleigh; |
| 172 |
float View_AtmosphericFogStartDistance; |
| 173 |
float View_AtmosphericFogDistanceOffset; |
| 174 |
float View_AtmosphericFogSunDiscScale; |
| 175 |
float View_AtmosphericFogSunDiscHalfApexAngleRadian; |
| 176 |
float PrePadding_View_2492; |
| 177 |
float4 View_AtmosphericFogSunDiscLuminance; |
| 178 |
uint View_AtmosphericFogRenderMask; |
| 179 |
uint View_AtmosphericFogInscatterAltitudeSampleNum; |
| 180 |
uint PrePadding_View_2520; |
| 181 |
uint PrePadding_View_2524; |
| 182 |
float4 View_AtmosphericFogSunColor; |
| 183 |
packed_float3 View_NormalCurvatureToRoughnessScaleBias; |
| 184 |
float View_RenderingReflectionCaptureMask; |
| 185 |
float4 View_AmbientCubemapTint; |
| 186 |
float View_AmbientCubemapIntensity; |
| 187 |
float View_SkyLightParameters; |
| 188 |
float PrePadding_View_2584; |
| 189 |
float PrePadding_View_2588; |
| 190 |
float4 View_SkyLightColor; |
| 191 |
float4 View_SkyIrradianceEnvironmentMap[7]; |
| 192 |
float View_MobilePreviewMode; |
| 193 |
float View_HMDEyePaddingOffset; |
| 194 |
float View_ReflectionCubemapMaxMip; |
| 195 |
float View_ShowDecalsMask; |
| 196 |
uint View_DistanceFieldAOSpecularOcclusionMode; |
| 197 |
float View_IndirectCapsuleSelfShadowingIntensity; |
| 198 |
float PrePadding_View_2744; |
| 199 |
float PrePadding_View_2748; |
| 200 |
packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight; |
| 201 |
int View_StereoPassIndex; |
| 202 |
float4 View_GlobalVolumeCenterAndExtent[4]; |
| 203 |
float4 View_GlobalVolumeWorldToUVAddAndMul[4]; |
| 204 |
float View_GlobalVolumeDimension; |
| 205 |
float View_GlobalVolumeTexelSize; |
| 206 |
float View_MaxGlobalDistance; |
| 207 |
float PrePadding_View_2908; |
| 208 |
int2 View_CursorPosition; |
| 209 |
float View_bCheckerboardSubsurfaceProfileRendering; |
| 210 |
float PrePadding_View_2924; |
| 211 |
packed_float3 View_VolumetricFogInvGridSize; |
| 212 |
float PrePadding_View_2940; |
| 213 |
packed_float3 View_VolumetricFogGridZParams; |
| 214 |
float PrePadding_View_2956; |
| 215 |
float2 View_VolumetricFogSVPosToVolumeUV; |
| 216 |
float View_VolumetricFogMaxDistance; |
| 217 |
float PrePadding_View_2972; |
| 218 |
packed_float3 View_VolumetricLightmapWorldToUVScale; |
| 219 |
float PrePadding_View_2988; |
| 220 |
packed_float3 View_VolumetricLightmapWorldToUVAdd; |
| 221 |
float PrePadding_View_3004; |
| 222 |
packed_float3 View_VolumetricLightmapIndirectionTextureSize; |
| 223 |
float View_VolumetricLightmapBrickSize; |
| 224 |
packed_float3 View_VolumetricLightmapBrickTexelSize; |
| 225 |
float View_StereoIPD; |
| 226 |
float View_IndirectLightingCacheShowFlag; |
| 227 |
float View_EyeToPixelSpreadAngle; |
| 228 |
float PrePadding_View_3048; |
| 229 |
float PrePadding_View_3052; |
| 230 |
float4x4 View_WorldToVirtualTexture; |
| 231 |
float4 View_VirtualTextureParams; |
| 232 |
float4 View_XRPassthroughCameraUVs[2]; |
| 233 |
}; |
| 234 |
|
| 235 |
struct type_Material |
| 236 |
{ |
| 237 |
float4 Material_VectorExpressions[5]; |
| 238 |
float4 Material_ScalarExpressions[2]; |
| 239 |
}; |
| 240 |
|
| 241 |
constant float4 _118 = {}; |
| 242 |
|
| 243 |
struct main0_out |
| 244 |
{ |
| 245 |
float4 out_var_TEXCOORD6 [[user(locn0)]]; |
| 246 |
float4 out_var_TEXCOORD7 [[user(locn1)]]; |
| 247 |
float4 out_var_TEXCOORD10_centroid [[user(locn2)]]; |
| 248 |
float4 out_var_TEXCOORD11_centroid [[user(locn3)]]; |
| 249 |
float gl_ClipDistance [[clip_distance]] [1]; |
| 250 |
float gl_ClipDistance_0 [[user(clip0)]]; |
| 251 |
float4 gl_Position [[position]]; |
| 252 |
}; |
| 253 |
|
| 254 |
struct main0_in |
| 255 |
{ |
| 256 |
float4 in_var_PN_DominantEdge2 [[attribute(3)]]; |
| 257 |
float4 in_var_PN_DominantEdge3 [[attribute(4)]]; |
| 258 |
float3 in_var_PN_DominantEdge4 [[attribute(5)]]; |
| 259 |
float3 in_var_PN_DominantEdge5 [[attribute(6)]]; |
| 260 |
float4 in_var_PN_DominantVertex1 [[attribute(8)]]; |
| 261 |
float3 in_var_PN_DominantVertex2 [[attribute(9)]]; |
| 262 |
float4 in_var_PN_POSITION_0 [[attribute(10)]]; |
| 263 |
float4 in_var_PN_POSITION_1 [[attribute(11)]]; |
| 264 |
float4 in_var_PN_POSITION_2 [[attribute(12)]]; |
| 265 |
float in_var_PN_WorldDisplacementMultiplier [[attribute(15)]]; |
| 266 |
float4 in_var_TEXCOORD10_centroid [[attribute(16)]]; |
| 267 |
float4 in_var_TEXCOORD11_centroid [[attribute(17)]]; |
| 268 |
float4 in_var_TEXCOORD6 [[attribute(18)]]; |
| 269 |
float4 in_var_TEXCOORD8 [[attribute(19)]]; |
| 270 |
}; |
| 271 |
|
| 272 |
struct main0_patchIn |
| 273 |
{ |
| 274 |
float4 in_var_PN_POSITION9 [[attribute(13)]]; |
| 275 |
patch_control_point<main0_in> gl_in; |
| 276 |
}; |
| 277 |
|
| 278 |
[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Material& Material [[buffer(1)]], texture3d<float> View_GlobalDistanceFieldTexture0 [[texture(0)]], texture3d<float> View_GlobalDistanceFieldTexture1 [[texture(1)]], texture3d<float> View_GlobalDistanceFieldTexture2 [[texture(2)]], texture3d<float> View_GlobalDistanceFieldTexture3 [[texture(3)]], sampler View_GlobalDistanceFieldSampler0 [[sampler(0)]], float3 gl_TessCoord [[position_in_patch]]) |
| 279 |
{ |
| 280 |
main0_out out = {}; |
| 281 |
spvUnsafeArray<float4, 3> _120 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD6, patchIn.gl_in[1].in_var_TEXCOORD6, patchIn.gl_in[2].in_var_TEXCOORD6 }); |
| 282 |
spvUnsafeArray<float4, 3> _121 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD8, patchIn.gl_in[1].in_var_TEXCOORD8, patchIn.gl_in[2].in_var_TEXCOORD8 }); |
| 283 |
spvUnsafeArray<float4, 3> _128 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD10_centroid, patchIn.gl_in[1].in_var_TEXCOORD10_centroid, patchIn.gl_in[2].in_var_TEXCOORD10_centroid }); |
| 284 |
spvUnsafeArray<float4, 3> _129 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_TEXCOORD11_centroid, patchIn.gl_in[1].in_var_TEXCOORD11_centroid, patchIn.gl_in[2].in_var_TEXCOORD11_centroid }); |
| 285 |
spvUnsafeArray<spvUnsafeArray<float4, 3>, 3> _136 = spvUnsafeArray<spvUnsafeArray<float4, 3>, 3>({ spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_POSITION_0, patchIn.gl_in[0].in_var_PN_POSITION_1, patchIn.gl_in[0].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[1].in_var_PN_POSITION_0, patchIn.gl_in[1].in_var_PN_POSITION_1, patchIn.gl_in[1].in_var_PN_POSITION_2 }), spvUnsafeArray<float4, 3>({ patchIn.gl_in[2].in_var_PN_POSITION_0, patchIn.gl_in[2].in_var_PN_POSITION_1, patchIn.gl_in[2].in_var_PN_POSITION_2 }) }); |
| 286 |
spvUnsafeArray<float, 3> _137 = spvUnsafeArray<float, 3>({ patchIn.gl_in[0].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[1].in_var_PN_WorldDisplacementMultiplier, patchIn.gl_in[2].in_var_PN_WorldDisplacementMultiplier }); |
| 287 |
spvUnsafeArray<float4, 3> _138 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantVertex1, patchIn.gl_in[1].in_var_PN_DominantVertex1, patchIn.gl_in[2].in_var_PN_DominantVertex1 }); |
| 288 |
spvUnsafeArray<float3, 3> _139 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantVertex2, patchIn.gl_in[1].in_var_PN_DominantVertex2, patchIn.gl_in[2].in_var_PN_DominantVertex2 }); |
| 289 |
spvUnsafeArray<float4, 3> _146 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge2, patchIn.gl_in[1].in_var_PN_DominantEdge2, patchIn.gl_in[2].in_var_PN_DominantEdge2 }); |
| 290 |
spvUnsafeArray<float4, 3> _147 = spvUnsafeArray<float4, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge3, patchIn.gl_in[1].in_var_PN_DominantEdge3, patchIn.gl_in[2].in_var_PN_DominantEdge3 }); |
| 291 |
spvUnsafeArray<float3, 3> _148 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge4, patchIn.gl_in[1].in_var_PN_DominantEdge4, patchIn.gl_in[2].in_var_PN_DominantEdge4 }); |
| 292 |
spvUnsafeArray<float3, 3> _149 = spvUnsafeArray<float3, 3>({ patchIn.gl_in[0].in_var_PN_DominantEdge5, patchIn.gl_in[1].in_var_PN_DominantEdge5, patchIn.gl_in[2].in_var_PN_DominantEdge5 }); |
| 293 |
float _190 = gl_TessCoord.x * gl_TessCoord.x; |
| 294 |
float _191 = gl_TessCoord.y * gl_TessCoord.y; |
| 295 |
float _192 = gl_TessCoord.z * gl_TessCoord.z; |
| 296 |
float4 _198 = float4(gl_TessCoord.x); |
| 297 |
float4 _202 = float4(gl_TessCoord.y); |
| 298 |
float4 _207 = float4(gl_TessCoord.z); |
| 299 |
float4 _210 = float4(_190 * 3.0); |
| 300 |
float4 _214 = float4(_191 * 3.0); |
| 301 |
float4 _221 = float4(_192 * 3.0); |
| 302 |
float4 _235 = ((((((((((_136[0][0] * float4(_190)) * _198) + ((_136[1][0] * float4(_191)) * _202)) + ((_136[2][0] * float4(_192)) * _207)) + ((_136[0][1] * _210) * _202)) + ((_136[0][2] * _214) * _198)) + ((_136[1][1] * _214) * _207)) + ((_136[1][2] * _221) * _202)) + ((_136[2][1] * _221) * _198)) + ((_136[2][2] * _210) * _207)) + ((((patchIn.in_var_PN_POSITION9 * float4(6.0)) * _207) * _198) * _202); |
| 303 |
float3 _237 = float3(gl_TessCoord.x); |
| 304 |
float3 _240 = float3(gl_TessCoord.y); |
| 305 |
float3 _254 = float3(gl_TessCoord.z); |
| 306 |
float3 _256 = ((_128[0].xyz * _237) + (_128[1].xyz * _240)).xyz + (_128[2].xyz * _254); |
| 307 |
float4 _259 = ((_129[0] * _198) + (_129[1] * _202)) + (_129[2] * _207); |
| 308 |
float3 _264 = _235.xyz; |
| 309 |
float3 _265 = _256.xyz; |
| 310 |
float3 _266 = _259.xyz; |
| 311 |
float3 _272 = _264 + float3(View.View_WorldCameraOrigin); |
| 312 |
float _279 = float(int(gl_TessCoord.x == 0.0)); |
| 313 |
float _282 = float(int(gl_TessCoord.y == 0.0)); |
| 314 |
float _285 = float(int(gl_TessCoord.z == 0.0)); |
| 315 |
float _286 = _279 + _282; |
| 316 |
float _287 = _286 + _285; |
| 317 |
float4 _387; |
| 318 |
float3 _388; |
| 319 |
if (float(int(_287 == 2.0)) == 1.0) |
| 320 |
{ |
| 321 |
float _363 = float(int((_282 + _285) == 2.0)); |
| 322 |
float _367 = float(int((_285 + _279) == 2.0)); |
| 323 |
float _370 = float(int(_286 == 2.0)); |
| 324 |
_387 = ((float4(_363) * _138[0]) + (float4(_367) * _138[1])) + (float4(_370) * _138[2]); |
| 325 |
_388 = ((float3(_363) * _139[0]) + (float3(_367) * _139[1])) + (float3(_370) * _139[2]); |
| 326 |
} |
| 327 |
else |
| 328 |
{ |
| 329 |
float4 _358; |
| 330 |
float3 _359; |
| 331 |
if (float(int(_287 == 1.0)) != 0.0) |
| 332 |
{ |
| 333 |
float4 _304 = float4(_279); |
| 334 |
float4 _306 = float4(_282); |
| 335 |
float4 _309 = float4(_285); |
| 336 |
float4 _311 = ((_304 * _146[0]) + (_306 * _146[1])) + (_309 * _146[2]); |
| 337 |
float4 _316 = ((_304 * _147[0]) + (_306 * _147[1])) + (_309 * _147[2]); |
| 338 |
float3 _331 = float3(_279); |
| 339 |
float3 _333 = float3(_282); |
| 340 |
float3 _336 = float3(_285); |
| 341 |
float3 _338 = ((_331 * _148[0]) + (_333 * _148[1])) + (_336 * _148[2]); |
| 342 |
float3 _343 = ((_331 * _149[0]) + (_333 * _149[1])) + (_336 * _149[2]); |
| 343 |
_358 = ((_304 * ((_202 * _311) + (_207 * _316))) + (_306 * ((_207 * _311) + (_198 * _316)))) + (_309 * ((_198 * _311) + (_202 * _316))); |
| 344 |
_359 = ((_331 * ((_240 * _338) + (_254 * _343))) + (_333 * ((_254 * _338) + (_237 * _343)))) + (_336 * ((_237 * _338) + (_240 * _343))); |
| 345 |
} |
| 346 |
else |
| 347 |
{ |
| 348 |
_358 = float4(_259.xyz, 0.0); |
| 349 |
_359 = _265; |
| 350 |
} |
| 351 |
_387 = _358; |
| 352 |
_388 = _359; |
| 353 |
} |
| 354 |
float3x3 _398; |
| 355 |
if (float(int(_287 == 0.0)) == 0.0) |
| 356 |
{ |
| 357 |
_398 = float3x3(_388, cross(_387.xyz, _388) * float3(_387.w), _387.xyz); |
| 358 |
} |
| 359 |
else |
| 360 |
{ |
| 361 |
_398 = float3x3(_265, cross(_266, _265) * float3(_259.w), _266); |
| 362 |
} |
| 363 |
float3 _411 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[0].xyz) + View.View_GlobalVolumeCenterAndExtent[0].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[0].xyz + View.View_GlobalVolumeCenterAndExtent[0].www) - _272, float3(0.0))); |
| 364 |
float _547; |
| 365 |
if (fast::min(_411.x, fast::min(_411.y, _411.z)) > (View.View_GlobalVolumeCenterAndExtent[0].w * View.View_GlobalVolumeTexelSize)) |
| 366 |
{ |
| 367 |
_547 = View_GlobalDistanceFieldTexture0.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[0u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[0u].xyz), level(0.0)).x; |
| 368 |
} |
| 369 |
else |
| 370 |
{ |
| 371 |
float3 _436 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[1].xyz) + View.View_GlobalVolumeCenterAndExtent[1].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[1].xyz + View.View_GlobalVolumeCenterAndExtent[1].www) - _272, float3(0.0))); |
| 372 |
float _535; |
| 373 |
if (fast::min(_436.x, fast::min(_436.y, _436.z)) > (View.View_GlobalVolumeCenterAndExtent[1].w * View.View_GlobalVolumeTexelSize)) |
| 374 |
{ |
| 375 |
_535 = View_GlobalDistanceFieldTexture1.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[1u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[1u].xyz), level(0.0)).x; |
| 376 |
} |
| 377 |
else |
| 378 |
{ |
| 379 |
float3 _459 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[2].xyz) + View.View_GlobalVolumeCenterAndExtent[2].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[2].xyz + View.View_GlobalVolumeCenterAndExtent[2].www) - _272, float3(0.0))); |
| 380 |
float3 _475 = fast::min(fast::max((_272 - View.View_GlobalVolumeCenterAndExtent[3].xyz) + View.View_GlobalVolumeCenterAndExtent[3].www, float3(0.0)), fast::max((View.View_GlobalVolumeCenterAndExtent[3].xyz + View.View_GlobalVolumeCenterAndExtent[3].www) - _272, float3(0.0))); |
| 381 |
float _480 = fast::min(_475.x, fast::min(_475.y, _475.z)); |
| 382 |
float _523; |
| 383 |
if (fast::min(_459.x, fast::min(_459.y, _459.z)) > (View.View_GlobalVolumeCenterAndExtent[2].w * View.View_GlobalVolumeTexelSize)) |
| 384 |
{ |
| 385 |
_523 = View_GlobalDistanceFieldTexture2.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[2u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[2u].xyz), level(0.0)).x; |
| 386 |
} |
| 387 |
else |
| 388 |
{ |
| 389 |
float _511; |
| 390 |
if (_480 > (View.View_GlobalVolumeCenterAndExtent[3].w * View.View_GlobalVolumeTexelSize)) |
| 391 |
{ |
| 392 |
_511 = mix(View.View_MaxGlobalDistance, View_GlobalDistanceFieldTexture3.sample(View_GlobalDistanceFieldSampler0, ((_272 * View.View_GlobalVolumeWorldToUVAddAndMul[3u].www) + View.View_GlobalVolumeWorldToUVAddAndMul[3u].xyz), level(0.0)).x, fast::clamp((_480 * 10.0) * View.View_GlobalVolumeWorldToUVAddAndMul[3].w, 0.0, 1.0)); |
| 393 |
} |
| 394 |
else |
| 395 |
{ |
| 396 |
_511 = View.View_MaxGlobalDistance; |
| 397 |
} |
| 398 |
_523 = _511; |
| 399 |
} |
| 400 |
_535 = _523; |
| 401 |
} |
| 402 |
_547 = _535; |
| 403 |
} |
| 404 |
float3 _565 = _264 + ((_398[2] * float3(fast::min(_547 + Material.Material_ScalarExpressions[0].z, 0.0) * Material.Material_ScalarExpressions[0].w)) * float3(((_137[0] * gl_TessCoord.x) + (_137[1] * gl_TessCoord.y)) + (_137[2] * gl_TessCoord.z))); |
| 405 |
float4 _574 = View.View_TranslatedWorldToClip * float4(_565.x, _565.y, _565.z, _235.w); |
| 406 |
float4 _579 = _574; |
| 407 |
_579.z = _574.z + (0.001000000047497451305389404296875 * _574.w); |
| 408 |
out.gl_Position = _579; |
| 409 |
out.out_var_TEXCOORD6 = ((_120[0] * _198) + (_120[1] * _202)) + (_120[2] * _207); |
| 410 |
out.out_var_TEXCOORD7 = ((_121[0] * _198) + (_121[1] * _202)) + (_121[2] * _207); |
| 411 |
out.out_var_TEXCOORD10_centroid = float4(_256.x, _256.y, _256.z, _118.w); |
| 412 |
out.out_var_TEXCOORD11_centroid = _259; |
| 413 |
out.gl_ClipDistance[0u] = dot(View.View_GlobalClippingPlane, float4(_565.xyz - float3(View.View_PreViewTranslation), 1.0)); |
| 414 |
out.gl_ClipDistance_0 = out.gl_ClipDistance[0]; |
| 415 |
return out; |
| 416 |
} |
| 417 |
|