Advertisement
Guest User

frag

a guest
Jul 9th, 2018
98
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 = 3, std140) uniform Material
  11. {
  12.     highp vec4 Material_VectorExpressions[3];
  13.     highp vec4 Material_ScalarExpressions[1];
  14. } _132;
  15.  
  16. layout(set = 3, binding = 2, std140) uniform PrecomputedLightingBuffer
  17. {
  18.     highp vec3 PrecomputedLightingBuffer_IndirectLightingCachePrimitiveAdd;
  19.     highp float PrePadding_PrecomputedLightingBuffer_12;
  20.     highp vec3 PrecomputedLightingBuffer_IndirectLightingCachePrimitiveScale;
  21.     highp float PrePadding_PrecomputedLightingBuffer_28;
  22.     highp vec3 PrecomputedLightingBuffer_IndirectLightingCacheMinUV;
  23.     highp float PrePadding_PrecomputedLightingBuffer_44;
  24.     highp vec3 PrecomputedLightingBuffer_IndirectLightingCacheMaxUV;
  25.     highp float PrePadding_PrecomputedLightingBuffer_60;
  26.     highp vec4 PrecomputedLightingBuffer_PointSkyBentNormal;
  27.     highp float PrecomputedLightingBuffer_DirectionalLightShadowing;
  28.     highp float PrePadding_PrecomputedLightingBuffer_84;
  29.     highp float PrePadding_PrecomputedLightingBuffer_88;
  30.     highp float PrePadding_PrecomputedLightingBuffer_92;
  31.     highp vec4 PrecomputedLightingBuffer_StaticShadowMapMasks;
  32.     highp vec4 PrecomputedLightingBuffer_InvUniformPenumbraSizes;
  33.     highp vec4 PrecomputedLightingBuffer_IndirectLightingSHCoefficients0[3];
  34.     highp vec4 PrecomputedLightingBuffer_IndirectLightingSHCoefficients1[3];
  35.     highp vec4 PrecomputedLightingBuffer_IndirectLightingSHCoefficients2;
  36.     highp vec4 PrecomputedLightingBuffer_IndirectLightingSHSingleCoefficient;
  37.     highp vec4 PrecomputedLightingBuffer_LightMapCoordinateScaleBias;
  38.     highp vec4 PrecomputedLightingBuffer_ShadowMapCoordinateScaleBias;
  39.     highp vec4 PrecomputedLightingBuffer_LightMapScale[2];
  40.     highp vec4 PrecomputedLightingBuffer_LightMapAdd[2];
  41. } _249;
  42.  
  43. layout(set = 3, binding = 1, std140) uniform View
  44. {
  45.     highp mat4 View_TranslatedWorldToClip;
  46.     highp mat4 View_WorldToClip;
  47.     highp mat4 View_TranslatedWorldToView;
  48.     highp mat4 View_ViewToTranslatedWorld;
  49.     highp mat4 View_TranslatedWorldToCameraView;
  50.     highp mat4 View_CameraViewToTranslatedWorld;
  51.     highp mat4 View_ViewToClip;
  52.     highp mat4 View_ViewToClipNoAA;
  53.     highp mat4 View_ClipToView;
  54.     highp mat4 View_ClipToTranslatedWorld;
  55.     highp mat4 View_SVPositionToTranslatedWorld;
  56.     highp mat4 View_ScreenToWorld;
  57.     highp mat4 View_ScreenToTranslatedWorld;
  58.     highp vec3 View_ViewForward;
  59.     highp float PrePadding_View_844;
  60.     highp vec3 View_ViewUp;
  61.     highp float PrePadding_View_860;
  62.     highp vec3 View_ViewRight;
  63.     highp float PrePadding_View_876;
  64.     highp vec3 View_HMDViewNoRollUp;
  65.     highp float PrePadding_View_892;
  66.     highp vec3 View_HMDViewNoRollRight;
  67.     highp float PrePadding_View_908;
  68.     highp vec4 View_InvDeviceZToWorldZTransform;
  69.     highp vec4 View_ScreenPositionScaleBias;
  70.     highp vec3 View_WorldCameraOrigin;
  71.     highp float PrePadding_View_956;
  72.     highp vec3 View_TranslatedWorldCameraOrigin;
  73.     highp float PrePadding_View_972;
  74.     highp vec3 View_WorldViewOrigin;
  75.     highp float PrePadding_View_988;
  76.     highp vec3 View_PreViewTranslation;
  77.     highp float PrePadding_View_1004;
  78.     highp mat4 View_PrevProjection;
  79.     highp mat4 View_PrevViewProj;
  80.     highp mat4 View_PrevViewRotationProj;
  81.     highp mat4 View_PrevViewToClip;
  82.     highp mat4 View_PrevClipToView;
  83.     highp mat4 View_PrevTranslatedWorldToClip;
  84.     highp mat4 View_PrevTranslatedWorldToView;
  85.     highp mat4 View_PrevViewToTranslatedWorld;
  86.     highp mat4 View_PrevTranslatedWorldToCameraView;
  87.     highp mat4 View_PrevCameraViewToTranslatedWorld;
  88.     highp vec3 View_PrevWorldCameraOrigin;
  89.     highp float PrePadding_View_1660;
  90.     highp vec3 View_PrevWorldViewOrigin;
  91.     highp float PrePadding_View_1676;
  92.     highp vec3 View_PrevPreViewTranslation;
  93.     highp float PrePadding_View_1692;
  94.     highp mat4 View_PrevInvViewProj;
  95.     highp mat4 View_PrevScreenToTranslatedWorld;
  96.     highp mat4 View_ClipToPrevClip;
  97.     highp vec4 View_TemporalAAJitter;
  98.     highp vec4 View_GlobalClippingPlane;
  99.     highp vec2 View_FieldOfViewWideAngles;
  100.     highp vec2 View_PrevFieldOfViewWideAngles;
  101.     highp vec4 View_ViewRectMin;
  102.     highp vec4 View_ViewSizeAndInvSize;
  103.     highp vec4 View_BufferSizeAndInvSize;
  104.     highp vec4 View_BufferBilinearUVMinMax;
  105.     int View_NumSceneColorMSAASamples;
  106.     highp float View_PreExposure;
  107.     highp float View_OneOverPreExposure;
  108.     highp float PrePadding_View_2012;
  109.     highp vec4 View_DiffuseOverrideParameter;
  110.     highp vec4 View_SpecularOverrideParameter;
  111.     highp vec4 View_NormalOverrideParameter;
  112.     highp vec2 View_RoughnessOverrideParameter;
  113.     highp float View_PrevFrameGameTime;
  114.     highp float View_PrevFrameRealTime;
  115.     highp float View_OutOfBoundsMask;
  116.     highp float PrePadding_View_2084;
  117.     highp float PrePadding_View_2088;
  118.     highp float PrePadding_View_2092;
  119.     highp vec3 View_WorldCameraMovementSinceLastFrame;
  120.     highp float View_CullingSign;
  121.     highp float View_NearPlane;
  122.     highp float View_AdaptiveTessellationFactor;
  123.     highp float View_GameTime;
  124.     highp float View_RealTime;
  125.     highp float View_MaterialTextureMipBias;
  126.     highp float View_MaterialTextureDerivativeMultiply;
  127.     uint View_Random;
  128.     uint View_FrameNumber;
  129.     uint View_StateFrameIndexMod8;
  130.     highp float View_CameraCut;
  131.     highp float View_UnlitViewmodeMask;
  132.     highp float PrePadding_View_2156;
  133.     highp vec4 View_DirectionalLightColor;
  134.     highp vec3 View_DirectionalLightDirection;
  135.     highp float PrePadding_View_2188;
  136.     highp vec4 View_TranslucencyLightingVolumeMin[2];
  137.     highp vec4 View_TranslucencyLightingVolumeInvSize[2];
  138.     highp vec4 View_TemporalAAParams;
  139.     highp vec4 View_CircleDOFParams;
  140.     highp float View_DepthOfFieldSensorWidth;
  141.     highp float View_DepthOfFieldFocalDistance;
  142.     highp float View_DepthOfFieldScale;
  143.     highp float View_DepthOfFieldFocalLength;
  144.     highp float View_DepthOfFieldFocalRegion;
  145.     highp float View_DepthOfFieldNearTransitionRegion;
  146.     highp float View_DepthOfFieldFarTransitionRegion;
  147.     highp float View_MotionBlurNormalizedToPixel;
  148.     highp float View_bSubsurfacePostprocessEnabled;
  149.     highp float View_GeneralPurposeTweak;
  150.     highp float View_DemosaicVposOffset;
  151.     highp float PrePadding_View_2332;
  152.     highp vec3 View_IndirectLightingColorScale;
  153.     highp float View_HDR32bppEncodingMode;
  154.     highp vec3 View_AtmosphericFogSunDirection;
  155.     highp float View_AtmosphericFogSunPower;
  156.     highp float View_AtmosphericFogPower;
  157.     highp float View_AtmosphericFogDensityScale;
  158.     highp float View_AtmosphericFogDensityOffset;
  159.     highp float View_AtmosphericFogGroundOffset;
  160.     highp float View_AtmosphericFogDistanceScale;
  161.     highp float View_AtmosphericFogAltitudeScale;
  162.     highp float View_AtmosphericFogHeightScaleRayleigh;
  163.     highp float View_AtmosphericFogStartDistance;
  164.     highp float View_AtmosphericFogDistanceOffset;
  165.     highp float View_AtmosphericFogSunDiscScale;
  166.     uint View_AtmosphericFogRenderMask;
  167.     uint View_AtmosphericFogInscatterAltitudeSampleNum;
  168.     highp vec4 View_AtmosphericFogSunColor;
  169.     highp vec3 View_NormalCurvatureToRoughnessScaleBias;
  170.     highp float View_RenderingReflectionCaptureMask;
  171.     highp vec4 View_AmbientCubemapTint;
  172.     highp float View_AmbientCubemapIntensity;
  173.     highp float View_SkyLightParameters;
  174.     highp float PrePadding_View_2472;
  175.     highp float PrePadding_View_2476;
  176.     highp vec4 View_SkyLightColor;
  177.     highp vec4 View_SkyIrradianceEnvironmentMap[7];
  178.     highp float View_MobilePreviewMode;
  179.     highp float View_HMDEyePaddingOffset;
  180.     highp float View_ReflectionCubemapMaxMip;
  181.     highp float View_ShowDecalsMask;
  182.     uint View_DistanceFieldAOSpecularOcclusionMode;
  183.     highp float View_IndirectCapsuleSelfShadowingIntensity;
  184.     highp float PrePadding_View_2632;
  185.     highp float PrePadding_View_2636;
  186.     highp vec3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
  187.     int View_StereoPassIndex;
  188.     highp vec4 View_GlobalVolumeCenterAndExtent[4];
  189.     highp vec4 View_GlobalVolumeWorldToUVAddAndMul[4];
  190.     highp float View_GlobalVolumeDimension;
  191.     highp float View_GlobalVolumeTexelSize;
  192.     highp float View_MaxGlobalDistance;
  193.     highp float View_bCheckerboardSubsurfaceProfileRendering;
  194.     highp vec3 View_VolumetricFogInvGridSize;
  195.     highp float PrePadding_View_2812;
  196.     highp vec3 View_VolumetricFogGridZParams;
  197.     highp float PrePadding_View_2828;
  198.     highp vec2 View_VolumetricFogSVPosToVolumeUV;
  199.     highp float View_VolumetricFogMaxDistance;
  200.     highp float PrePadding_View_2844;
  201.     highp vec3 View_VolumetricLightmapWorldToUVScale;
  202.     highp float PrePadding_View_2860;
  203.     highp vec3 View_VolumetricLightmapWorldToUVAdd;
  204.     highp float PrePadding_View_2876;
  205.     highp vec3 View_VolumetricLightmapIndirectionTextureSize;
  206.     highp float View_VolumetricLightmapBrickSize;
  207.     highp vec3 View_VolumetricLightmapBrickTexelSize;
  208.     highp float View_StereoIPD;
  209. } _346;
  210.  
  211. layout(set = 3, binding = 7) uniform highp sampler2D Material_Texture2D_0;
  212. layout(set = 3, binding = 6) uniform highp sampler2D Material_Texture2D_1;
  213. layout(set = 3, binding = 5) uniform highp sampler2D Material_Texture2D_2;
  214. layout(set = 3, binding = 8) uniform highp sampler2D PrecomputedLightingBuffer_LightMapTexture;
  215. layout(set = 3, binding = 4) uniform highp samplerCube ReflectionCubemap;
  216.  
  217. layout(location = 4) in highp vec4 in_TEXCOORD8;
  218. layout(location = 2) in highp vec4 in_TEXCOORD0;
  219. layout(location = 1) in highp vec4 in_TEXCOORD11;
  220. layout(location = 0) in highp vec4 in_TEXCOORD10;
  221. layout(location = 3) in highp vec4 in_TEXCOORD4;
  222. layout(location = 0) out highp vec4 out_Target0;
  223.  
  224. void main()
  225. {
  226.     highp vec3 v0 = _16.pu_h[1].xyz;
  227.     highp vec3 v2 = normalize(-in_TEXCOORD8.xyz);
  228.     highp vec2 v3 = (texture(Material_Texture2D_0, in_TEXCOORD0.xy).xy * vec2(2.0)) + vec2(-1.0);
  229.     highp vec4 v4;
  230.     v4.w = 1.0;
  231.     v4 = vec4(v3.x, v3.y, v4.z, v4.w);
  232.     v4.z = sqrt(clamp(1.0 + (-dot(v3, v3)), 0.0, 1.0));
  233.     highp vec3 v5 = normalize((in_TEXCOORD11.xyz * v4.zzz) + (((cross(in_TEXCOORD11.xyz, in_TEXCOORD10.xyz) * in_TEXCOORD11.www) * v3.yyy) + (in_TEXCOORD10.xyz * v3.xxx)));
  234.     highp vec3 v6 = (-v2) + ((v5 * vec3(dot(v5, v2))) * vec3(2.0));
  235.     highp vec4 v7 = texture(Material_Texture2D_1, in_TEXCOORD0.xy);
  236.     highp vec2 v8 = in_TEXCOORD0.xy * vec2(1.12399995326995849609375, 1.6019999980926513671875);
  237.     highp vec2 v9 = v8 + (-fract(v8));
  238.     highp vec3 v10 = _132.Material_VectorExpressions[2].xyz;
  239.     highp vec3 v11 = clamp(v7.xyz, vec3(0.0), vec3(1.0));
  240.     highp float f12 = clamp(min(max(mix(_132.Material_ScalarExpressions[0].y, _132.Material_ScalarExpressions[0].x, mix(texture(Material_Texture2D_2, in_TEXCOORD0.xy).y, v7.w, min(max(v9.x + v9.y, 0.0), 1.0))), 0.0), 1.0), 0.119999997317790985107421875, 1.0);
  241.     highp vec4 v15 = (vec4(f12) * vec4(-1.0, -0.0274999998509883880615234375, -0.572000026702880859375, 0.02199999988079071044921875)) + vec4(1.0, 0.0425000004470348358154296875, 1.03999996185302734375, -0.039999999105930328369140625);
  242.     highp vec2 v16 = (vec2(-1.03999996185302734375, 1.03999996185302734375) * vec2((min(v15.x * v15.x, exp2((-9.27999973297119140625) * max(dot(v5, v2), 0.0))) * v15.x) + v15.y)) + v15.zw;
  243.     highp vec2 v14 = v16;
  244.     v14.y = v16.y * clamp(50.0 * v11.y, 0.0, 1.0);
  245.     highp vec3 v13 = (v11 * v16.xxx) + v14.yyy;
  246.     highp vec2 v17 = in_TEXCOORD4.xy * vec2(1.0, 0.5);
  247.     highp vec3 v18 = (texture(PrecomputedLightingBuffer_LightMapTexture, v17).xyz * _249.PrecomputedLightingBuffer_LightMapScale[0].xyz) + _249.PrecomputedLightingBuffer_LightMapAdd[0].xyz;
  248.     highp float f19 = dot(v18, vec3(0.300000011920928955078125, 0.589999973773956298828125, 0.10999999940395355224609375));
  249.     highp vec4 v20;
  250.     v20.w = 1.0;
  251.     v20 = vec4(v5.yzx.x, v5.yzx.y, v5.yzx.z, v20.w);
  252.     highp float f21 = (exp2((f19 * 16.0) + (-8.0)) + (-0.00390625)) * max(0.0, dot((texture(PrecomputedLightingBuffer_LightMapTexture, v17 + vec2(0.0, 0.5)) * _249.PrecomputedLightingBuffer_LightMapScale[1]) + _249.PrecomputedLightingBuffer_LightMapAdd[1], v20));
  253.     highp vec3 v22 = v18 * vec3(f21 / f19);
  254.     highp vec4 v23;
  255.     v23 = vec4(v22.x, v22.y, v22.z, v23.w);
  256.     v23.w = f21;
  257.     highp vec3 v24 = v22 * (v11 + (-v11));
  258.     highp float f27 = float(_16.pu_h[0].x > 0.0);
  259.     highp float f26 = f27;
  260.     highp float f29 = _16.pu_h[0].x;
  261.     highp float _329;
  262.     if (f26 != 0.0)
  263.     {
  264.         _329 = f29;
  265.     }
  266.     else
  267.     {
  268.         _329 = _346.View_ReflectionCubemapMaxMip;
  269.     }
  270.     highp float f28 = _329;
  271.     highp vec4 v30 = textureLod(ReflectionCubemap, v6, (f28 + (-1.0)) + (-(1.0 + (-(1.2000000476837158203125 * log2(f12))))));
  272.     highp vec3 v25;
  273.     if (f26 != 0.0)
  274.     {
  275.         v25 = v30.xyz * _346.View_SkyLightColor.xyz;
  276.     }
  277.     else
  278.     {
  279.         highp vec3 v31 = v30.xyz * vec3(v30.w * 16.0);
  280.         v25 = (v31 * v31) * v0.xxx;
  281.     }
  282.     highp vec3 _407 = (v24 + ((v25 * v23.www) * v13)) + max(v10, vec3(0.0));
  283.     highp vec4 v1;
  284.     v1 = vec4(_407.x, _407.y, _407.z, v1.w);
  285.     v1.w = 0.0;
  286.     v1.w = in_TEXCOORD8.w;
  287.     out_Target0 = v1;
  288. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement