Advertisement
Guest User

frag

a guest
Jul 9th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #version 310 es
  2. precision mediump float;
  3. precision highp int;
  4.  
  5. layout(set = 3, binding = 0, std140) uniform HLSLCC_CBh
  6. {
  7.     highp vec4 pu_h[2];
  8. } _16;
  9.  
  10. layout(set = 3, binding = 5, std140) uniform Material
  11. {
  12.     highp vec4 Material_VectorExpressions[5];
  13. } _154;
  14.  
  15. layout(set = 3, binding = 3, std140) uniform PrecomputedLightingBuffer
  16. {
  17.     highp vec3 PrecomputedLightingBuffer_IndirectLightingCachePrimitiveAdd;
  18.     highp float PrePadding_PrecomputedLightingBuffer_12;
  19.     highp vec3 PrecomputedLightingBuffer_IndirectLightingCachePrimitiveScale;
  20.     highp float PrePadding_PrecomputedLightingBuffer_28;
  21.     highp vec3 PrecomputedLightingBuffer_IndirectLightingCacheMinUV;
  22.     highp float PrePadding_PrecomputedLightingBuffer_44;
  23.     highp vec3 PrecomputedLightingBuffer_IndirectLightingCacheMaxUV;
  24.     highp float PrePadding_PrecomputedLightingBuffer_60;
  25.     highp vec4 PrecomputedLightingBuffer_PointSkyBentNormal;
  26.     highp float PrecomputedLightingBuffer_DirectionalLightShadowing;
  27.     highp float PrePadding_PrecomputedLightingBuffer_84;
  28.     highp float PrePadding_PrecomputedLightingBuffer_88;
  29.     highp float PrePadding_PrecomputedLightingBuffer_92;
  30.     highp vec4 PrecomputedLightingBuffer_StaticShadowMapMasks;
  31.     highp vec4 PrecomputedLightingBuffer_InvUniformPenumbraSizes;
  32.     highp vec4 PrecomputedLightingBuffer_IndirectLightingSHCoefficients0[3];
  33.     highp vec4 PrecomputedLightingBuffer_IndirectLightingSHCoefficients1[3];
  34.     highp vec4 PrecomputedLightingBuffer_IndirectLightingSHCoefficients2;
  35.     highp vec4 PrecomputedLightingBuffer_IndirectLightingSHSingleCoefficient;
  36.     highp vec4 PrecomputedLightingBuffer_LightMapCoordinateScaleBias;
  37.     highp vec4 PrecomputedLightingBuffer_ShadowMapCoordinateScaleBias;
  38.     highp vec4 PrecomputedLightingBuffer_LightMapScale[2];
  39.     highp vec4 PrecomputedLightingBuffer_LightMapAdd[2];
  40. } _421;
  41.  
  42. layout(set = 3, binding = 2, std140) uniform Primitive
  43. {
  44.     highp mat4 Primitive_LocalToWorld;
  45.     highp mat4 Primitive_WorldToLocal;
  46.     highp vec4 Primitive_ObjectWorldPositionAndRadius;
  47.     highp vec3 Primitive_ObjectBounds;
  48.     highp float Primitive_LocalToWorldDeterminantSign;
  49.     highp vec3 Primitive_ActorWorldPosition;
  50.     highp float Primitive_DecalReceiverMask;
  51.     highp float Primitive_PerObjectGBufferData;
  52.     highp float Primitive_UseSingleSampleShadowFromStationaryLights;
  53.     highp float Primitive_UseVolumetricLightmapShadowFromStationaryLights;
  54.     highp float Primitive_UseEditorDepthTest;
  55.     highp vec4 Primitive_ObjectOrientation;
  56.     highp vec4 Primitive_NonUniformScale;
  57.     highp vec4 Primitive_InvNonUniformScale;
  58.     highp vec3 Primitive_LocalObjectBoundsMin;
  59.     highp float PrePadding_Primitive_252;
  60.     highp vec3 Primitive_LocalObjectBoundsMax;
  61.     uint Primitive_LightingChannelMask;
  62.     highp float Primitive_LpvBiasMultiplier;
  63. } _490;
  64.  
  65. layout(set = 3, binding = 4, std140) uniform MobileDirectionalLight
  66. {
  67.     highp vec4 MobileDirectionalLight_DirectionalLightColor;
  68.     highp vec3 MobileDirectionalLight_DirectionalLightDirection;
  69.     highp float MobileDirectionalLight_DirectionalLightShadowTransition;
  70.     highp vec4 MobileDirectionalLight_DirectionalLightShadowSize;
  71.     highp mat4 MobileDirectionalLight_DirectionalLightScreenToShadow[4];
  72.     highp vec4 MobileDirectionalLight_DirectionalLightShadowDistances;
  73.     highp vec2 MobileDirectionalLight_DirectionalLightDistanceFadeMAD;
  74. } _508;
  75.  
  76. layout(set = 3, binding = 1, std140) uniform View
  77. {
  78.     highp mat4 View_TranslatedWorldToClip;
  79.     highp mat4 View_WorldToClip;
  80.     highp mat4 View_TranslatedWorldToView;
  81.     highp mat4 View_ViewToTranslatedWorld;
  82.     highp mat4 View_TranslatedWorldToCameraView;
  83.     highp mat4 View_CameraViewToTranslatedWorld;
  84.     highp mat4 View_ViewToClip;
  85.     highp mat4 View_ViewToClipNoAA;
  86.     highp mat4 View_ClipToView;
  87.     highp mat4 View_ClipToTranslatedWorld;
  88.     highp mat4 View_SVPositionToTranslatedWorld;
  89.     highp mat4 View_ScreenToWorld;
  90.     highp mat4 View_ScreenToTranslatedWorld;
  91.     highp vec3 View_ViewForward;
  92.     highp float PrePadding_View_844;
  93.     highp vec3 View_ViewUp;
  94.     highp float PrePadding_View_860;
  95.     highp vec3 View_ViewRight;
  96.     highp float PrePadding_View_876;
  97.     highp vec3 View_HMDViewNoRollUp;
  98.     highp float PrePadding_View_892;
  99.     highp vec3 View_HMDViewNoRollRight;
  100.     highp float PrePadding_View_908;
  101.     highp vec4 View_InvDeviceZToWorldZTransform;
  102.     highp vec4 View_ScreenPositionScaleBias;
  103.     highp vec3 View_WorldCameraOrigin;
  104.     highp float PrePadding_View_956;
  105.     highp vec3 View_TranslatedWorldCameraOrigin;
  106.     highp float PrePadding_View_972;
  107.     highp vec3 View_WorldViewOrigin;
  108.     highp float PrePadding_View_988;
  109.     highp vec3 View_PreViewTranslation;
  110.     highp float PrePadding_View_1004;
  111.     highp mat4 View_PrevProjection;
  112.     highp mat4 View_PrevViewProj;
  113.     highp mat4 View_PrevViewRotationProj;
  114.     highp mat4 View_PrevViewToClip;
  115.     highp mat4 View_PrevClipToView;
  116.     highp mat4 View_PrevTranslatedWorldToClip;
  117.     highp mat4 View_PrevTranslatedWorldToView;
  118.     highp mat4 View_PrevViewToTranslatedWorld;
  119.     highp mat4 View_PrevTranslatedWorldToCameraView;
  120.     highp mat4 View_PrevCameraViewToTranslatedWorld;
  121.     highp vec3 View_PrevWorldCameraOrigin;
  122.     highp float PrePadding_View_1660;
  123.     highp vec3 View_PrevWorldViewOrigin;
  124.     highp float PrePadding_View_1676;
  125.     highp vec3 View_PrevPreViewTranslation;
  126.     highp float PrePadding_View_1692;
  127.     highp mat4 View_PrevInvViewProj;
  128.     highp mat4 View_PrevScreenToTranslatedWorld;
  129.     highp mat4 View_ClipToPrevClip;
  130.     highp vec4 View_TemporalAAJitter;
  131.     highp vec4 View_GlobalClippingPlane;
  132.     highp vec2 View_FieldOfViewWideAngles;
  133.     highp vec2 View_PrevFieldOfViewWideAngles;
  134.     highp vec4 View_ViewRectMin;
  135.     highp vec4 View_ViewSizeAndInvSize;
  136.     highp vec4 View_BufferSizeAndInvSize;
  137.     highp vec4 View_BufferBilinearUVMinMax;
  138.     int View_NumSceneColorMSAASamples;
  139.     highp float View_PreExposure;
  140.     highp float View_OneOverPreExposure;
  141.     highp float PrePadding_View_2012;
  142.     highp vec4 View_DiffuseOverrideParameter;
  143.     highp vec4 View_SpecularOverrideParameter;
  144.     highp vec4 View_NormalOverrideParameter;
  145.     highp vec2 View_RoughnessOverrideParameter;
  146.     highp float View_PrevFrameGameTime;
  147.     highp float View_PrevFrameRealTime;
  148.     highp float View_OutOfBoundsMask;
  149.     highp float PrePadding_View_2084;
  150.     highp float PrePadding_View_2088;
  151.     highp float PrePadding_View_2092;
  152.     highp vec3 View_WorldCameraMovementSinceLastFrame;
  153.     highp float View_CullingSign;
  154.     highp float View_NearPlane;
  155.     highp float View_AdaptiveTessellationFactor;
  156.     highp float View_GameTime;
  157.     highp float View_RealTime;
  158.     highp float View_MaterialTextureMipBias;
  159.     highp float View_MaterialTextureDerivativeMultiply;
  160.     uint View_Random;
  161.     uint View_FrameNumber;
  162.     uint View_StateFrameIndexMod8;
  163.     highp float View_CameraCut;
  164.     highp float View_UnlitViewmodeMask;
  165.     highp float PrePadding_View_2156;
  166.     highp vec4 View_DirectionalLightColor;
  167.     highp vec3 View_DirectionalLightDirection;
  168.     highp float PrePadding_View_2188;
  169.     highp vec4 View_TranslucencyLightingVolumeMin[2];
  170.     highp vec4 View_TranslucencyLightingVolumeInvSize[2];
  171.     highp vec4 View_TemporalAAParams;
  172.     highp vec4 View_CircleDOFParams;
  173.     highp float View_DepthOfFieldSensorWidth;
  174.     highp float View_DepthOfFieldFocalDistance;
  175.     highp float View_DepthOfFieldScale;
  176.     highp float View_DepthOfFieldFocalLength;
  177.     highp float View_DepthOfFieldFocalRegion;
  178.     highp float View_DepthOfFieldNearTransitionRegion;
  179.     highp float View_DepthOfFieldFarTransitionRegion;
  180.     highp float View_MotionBlurNormalizedToPixel;
  181.     highp float View_bSubsurfacePostprocessEnabled;
  182.     highp float View_GeneralPurposeTweak;
  183.     highp float View_DemosaicVposOffset;
  184.     highp float PrePadding_View_2332;
  185.     highp vec3 View_IndirectLightingColorScale;
  186.     highp float View_HDR32bppEncodingMode;
  187.     highp vec3 View_AtmosphericFogSunDirection;
  188.     highp float View_AtmosphericFogSunPower;
  189.     highp float View_AtmosphericFogPower;
  190.     highp float View_AtmosphericFogDensityScale;
  191.     highp float View_AtmosphericFogDensityOffset;
  192.     highp float View_AtmosphericFogGroundOffset;
  193.     highp float View_AtmosphericFogDistanceScale;
  194.     highp float View_AtmosphericFogAltitudeScale;
  195.     highp float View_AtmosphericFogHeightScaleRayleigh;
  196.     highp float View_AtmosphericFogStartDistance;
  197.     highp float View_AtmosphericFogDistanceOffset;
  198.     highp float View_AtmosphericFogSunDiscScale;
  199.     uint View_AtmosphericFogRenderMask;
  200.     uint View_AtmosphericFogInscatterAltitudeSampleNum;
  201.     highp vec4 View_AtmosphericFogSunColor;
  202.     highp vec3 View_NormalCurvatureToRoughnessScaleBias;
  203.     highp float View_RenderingReflectionCaptureMask;
  204.     highp vec4 View_AmbientCubemapTint;
  205.     highp float View_AmbientCubemapIntensity;
  206.     highp float View_SkyLightParameters;
  207.     highp float PrePadding_View_2472;
  208.     highp float PrePadding_View_2476;
  209.     highp vec4 View_SkyLightColor;
  210.     highp vec4 View_SkyIrradianceEnvironmentMap[7];
  211.     highp float View_MobilePreviewMode;
  212.     highp float View_HMDEyePaddingOffset;
  213.     highp float View_ReflectionCubemapMaxMip;
  214.     highp float View_ShowDecalsMask;
  215.     uint View_DistanceFieldAOSpecularOcclusionMode;
  216.     highp float View_IndirectCapsuleSelfShadowingIntensity;
  217.     highp float PrePadding_View_2632;
  218.     highp float PrePadding_View_2636;
  219.     highp vec3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
  220.     int View_StereoPassIndex;
  221.     highp vec4 View_GlobalVolumeCenterAndExtent[4];
  222.     highp vec4 View_GlobalVolumeWorldToUVAddAndMul[4];
  223.     highp float View_GlobalVolumeDimension;
  224.     highp float View_GlobalVolumeTexelSize;
  225.     highp float View_MaxGlobalDistance;
  226.     highp float View_bCheckerboardSubsurfaceProfileRendering;
  227.     highp vec3 View_VolumetricFogInvGridSize;
  228.     highp float PrePadding_View_2812;
  229.     highp vec3 View_VolumetricFogGridZParams;
  230.     highp float PrePadding_View_2828;
  231.     highp vec2 View_VolumetricFogSVPosToVolumeUV;
  232.     highp float View_VolumetricFogMaxDistance;
  233.     highp float PrePadding_View_2844;
  234.     highp vec3 View_VolumetricLightmapWorldToUVScale;
  235.     highp float PrePadding_View_2860;
  236.     highp vec3 View_VolumetricLightmapWorldToUVAdd;
  237.     highp float PrePadding_View_2876;
  238.     highp vec3 View_VolumetricLightmapIndirectionTextureSize;
  239.     highp float View_VolumetricLightmapBrickSize;
  240.     highp vec3 View_VolumetricLightmapBrickTexelSize;
  241.     highp float View_StereoIPD;
  242. } _595;
  243.  
  244. layout(set = 3, binding = 10) uniform highp sampler2D Material_Texture2D_0;
  245. layout(set = 3, binding = 9) uniform highp sampler2D Material_Texture2D_1;
  246. layout(set = 3, binding = 8) uniform highp texture2D Material_Texture2D_2;
  247. layout(set = 3, binding = 11) uniform highp sampler pz0;
  248. layout(set = 3, binding = 7) uniform highp texture2D Material_Texture2D_3;
  249. layout(set = 3, binding = 6) uniform highp samplerCube ReflectionCubemap;
  250.  
  251. layout(location = 1) in highp vec4 in_TEXCOORD11;
  252. layout(location = 0) in highp vec4 in_TEXCOORD10;
  253. layout(location = 4) in highp vec4 in_TEXCOORD8;
  254. layout(location = 3) in highp vec2 in_TEXCOORD0;
  255. layout(location = 0) out highp vec4 out_Target0;
  256.  
  257. void main()
  258. {
  259.     highp vec3 v0 = _16.pu_h[1].xyz;
  260.     highp vec3 v2 = cross(in_TEXCOORD11.xyz, in_TEXCOORD10.xyz) * in_TEXCOORD11.www;
  261.     highp vec3 v3 = normalize(-in_TEXCOORD8.xyz);
  262.     highp vec2 v4 = (texture(Material_Texture2D_0, in_TEXCOORD0).xy * vec2(2.0)) + vec2(-1.0);
  263.     highp vec4 v5;
  264.     v5.w = 1.0;
  265.     v5 = vec4(v4.x, v4.y, v5.z, v5.w);
  266.     v5.z = sqrt(clamp(1.0 + (-dot(v4, v4)), 0.0, 1.0));
  267.     highp vec2 v6 = v4 * vec2(-1.0);
  268.     highp vec3 v7;
  269.     v7 = vec3(v6.x, v6.y, v7.z);
  270.     v7.z = v5.z;
  271.     highp vec3 v8;
  272.     v8 = vec3(v6.x, v6.y, v8.z);
  273.     v8.z = v5.z;
  274.     highp vec3 v9 = (vec3(0.0, 0.0, 2.0) * vec3(dot(vec3(0.0, 0.0, 2.0), v7))) + (-(vec3(2.0) * v8));
  275.     highp float f11 = length(v9);
  276.     highp vec3 v10 = v9 / vec3(f11);
  277.     highp vec3 v12 = normalize((in_TEXCOORD11.xyz * v10.zzz) + ((v2 * v10.yyy) + (in_TEXCOORD10.xyz * v10.xxx)));
  278.     highp vec3 v13 = (-v3) + ((v12 * vec3(dot(v12, v3))) * vec3(2.0));
  279.     highp vec4 v14 = texture(Material_Texture2D_1, in_TEXCOORD0);
  280.     highp vec3 v15 = _154.Material_VectorExpressions[2].xyz;
  281.     if (false)
  282.     {
  283.         discard;
  284.     }
  285.     highp vec3 v16 = clamp(mix(mix(mix(_154.Material_VectorExpressions[4].xyz, _154.Material_VectorExpressions[4].xyz, v14.yyy), texture(sampler2D(Material_Texture2D_2, pz0), vec2(8.0) * in_TEXCOORD0).xyz * vec3(0.25), v14.xxx), texture(sampler2D(Material_Texture2D_3, pz0), vec2(50.0) * in_TEXCOORD0).xyz * vec3(0.2249999940395355224609375), v14.zzz), vec3(0.0), vec3(1.0));
  286.     highp float f17 = clamp(mix(mix(vec3(0.0), vec3(1.0), v14.xxx), vec3(0.0), v14.zzz).x, 0.0, 1.0);
  287.     highp vec3 v18 = v16 + (-(v16 * vec3(f17)));
  288.     highp vec3 v19 = vec3(0.039999999105930328369140625 + (-(0.039999999105930328369140625 * f17))) + (v16 * vec3(f17));
  289.     highp float f20 = clamp(mix(mix(vec3(0.100000001490116119384765625), vec3(mix(0.37999999523162841796875, 0.550000011920928955078125, texture(sampler2D(Material_Texture2D_2, pz0), vec2(8.0) * in_TEXCOORD0).x)), v14.xxx), vec3(mix(0.550000011920928955078125, 0.75, texture(sampler2D(Material_Texture2D_3, pz0), vec2(50.0) * in_TEXCOORD0).x)), v14.zzz).x, 0.119999997317790985107421875, 1.0);
  290.     highp vec4 v23 = (vec4(f20) * vec4(-1.0, -0.0274999998509883880615234375, -0.572000026702880859375, 0.02199999988079071044921875)) + vec4(1.0, 0.0425000004470348358154296875, 1.03999996185302734375, -0.039999999105930328369140625);
  291.     highp vec2 v24 = (vec2(-1.03999996185302734375, 1.03999996185302734375) * vec2((min(v23.x * v23.x, exp2((-9.27999973297119140625) * max(dot(v12, v3), 0.0))) * v23.x) + v23.y)) + v23.zw;
  292.     highp vec2 v22 = v24;
  293.     v22.y = v24.y * clamp(50.0 * v19.y, 0.0, 1.0);
  294.     highp vec3 v21 = (v19 * v24.xxx) + v22.yyy;
  295.     highp vec4 v27;
  296.     v27.x = 0.2820949852466583251953125;
  297.     v27.y = (-0.48860299587249755859375) * v12.y;
  298.     v27.z = 0.48860299587249755859375 * v12.z;
  299.     v27.w = (-0.48860299587249755859375) * v12.x;
  300.     highp vec3 v29 = v12 * v12;
  301.     highp vec4 v28;
  302.     v28.x = (1.09254801273345947265625 * v12.x) * v12.y;
  303.     v28.y = ((-1.09254801273345947265625) * v12.y) * v12.z;
  304.     v28.z = 0.3153919875621795654296875 * ((3.0 * v29.z) + (-1.0));
  305.     v28.w = ((-1.09254801273345947265625) * v12.x) * v12.z;
  306.     highp vec4 v25 = v27;
  307.     v25.x = 0.88622748851776123046875;
  308.     highp vec3 _397 = v27.yzw * vec3(2.0943949222564697265625);
  309.     v25 = vec4(v25.x, _397.x, _397.y, _397.z);
  310.     highp vec4 v26 = v28 * vec4(0.785398185253143310546875);
  311.     highp float f30 = 0.4290426075458526611328125 * (v29.x + (-v29.y));
  312.     highp vec3 v31 = vec3(0.0);
  313.     v31.x = (dot(_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients0[0], v25) + dot(_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients1[0], v26)) + (_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients2.x * f30);
  314.     v31.y = (dot(_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients0[1], v25) + dot(_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients1[1], v26)) + (_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients2.y * f30);
  315.     v31.z = (dot(_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients0[2], v25) + dot(_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients1[2], v26)) + (_421.PrecomputedLightingBuffer_IndirectLightingSHCoefficients2.z * f30);
  316.     highp vec3 v32 = max(vec3(0.0), v31);
  317.     highp float f33 = dot(v32, vec3(0.300000011920928955078125, 0.589999973773956298828125, 0.10999999940395355224609375));
  318.     highp vec3 v34 = v18 * v32;
  319.     highp float _486;
  320.     if (_490.Primitive_UseSingleSampleShadowFromStationaryLights > 0.0)
  321.     {
  322.         _486 = _421.PrecomputedLightingBuffer_DirectionalLightShadowing;
  323.     }
  324.     else
  325.     {
  326.         _486 = 1.0;
  327.     }
  328.     highp float f35 = _486;
  329.     highp vec3 v36 = normalize(v3 + _508.MobileDirectionalLight_DirectionalLightDirection);
  330.     highp vec3 v37 = cross(v12, v36);
  331.     highp float f38 = f20 * f20;
  332.     highp float f39 = max(0.0, dot(v12, v36)) * f38;
  333.     highp float f40 = f38 / (dot(v37, v37) + (f39 * f39));
  334.     highp vec3 v41 = v34 + ((vec3(f35 * max(0.0, dot(v12, _508.MobileDirectionalLight_DirectionalLightDirection))) * _508.MobileDirectionalLight_DirectionalLightColor.xyz) * (v18 + (v21 * vec3(((f20 * 0.25) + 0.25) * min(f40 * f40, 65504.0)))));
  335.     highp float f44 = float(_16.pu_h[0].x > 0.0);
  336.     highp float f43 = f44;
  337.     highp float f46 = _16.pu_h[0].x;
  338.     highp float _580;
  339.     if (f43 != 0.0)
  340.     {
  341.         _580 = f46;
  342.     }
  343.     else
  344.     {
  345.         _580 = _595.View_ReflectionCubemapMaxMip;
  346.     }
  347.     highp float f45 = _580;
  348.     highp vec4 v47 = textureLod(ReflectionCubemap, v13, (f45 + (-1.0)) + (-(1.0 + (-(1.2000000476837158203125 * log2(f20))))));
  349.     highp vec3 v42;
  350.     if (f43 != 0.0)
  351.     {
  352.         v42 = v47.xyz * _595.View_SkyLightColor.xyz;
  353.     }
  354.     else
  355.     {
  356.         highp vec3 v48 = v47.xyz * vec3(v47.w * 16.0);
  357.         v42 = (v48 * v48) * v0.xxx;
  358.     }
  359.     highp vec3 _657 = (v41 + ((v42 * vec3(f33)) * v21)) + max(v15, vec3(0.0));
  360.     highp vec4 v1;
  361.     v1 = vec4(_657.x, _657.y, _657.z, v1.w);
  362.     v1.w = 0.0;
  363.     v1.w = in_TEXCOORD8.w;
  364.     out_Target0 = v1;
  365. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement