vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return textureLod( s, coord.xy, coord.w); } float xll_saturate_f( float x) { return clamp( x, 0.0, 1.0); } vec2 xll_saturate_vf2( vec2 x) { return clamp( x, 0.0, 1.0); } vec3 xll_saturate_vf3( vec3 x) { return clamp( x, 0.0, 1.0); } vec4 xll_saturate_vf4( vec4 x) { return clamp( x, 0.0, 1.0); } mat2 xll_saturate_mf2x2(mat2 m) { return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0)); } mat3 xll_saturate_mf3x3(mat3 m) { return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0)); } mat4 xll_saturate_mf4x4(mat4 m) { return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0)); } #line 968 struct v2f { highp vec4 pos; highp vec2 uv; highp vec4 uvPosPos; }; #line 342 #line 508 #line 974 uniform highp vec4 _MainTex_TexelSize; uniform sampler2D _MainTex; #line 978 #line 342 highp float FxaaLuma( in highp vec4 rgba ) { return rgba.w; } #line 508 highp vec4 FxaaPixelShader( in highp vec2 pos, in highp vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in highp vec2 fxaaQualityRcpFrame, in highp vec4 fxaaConsoleRcpFrameOpt, in highp vec4 fxaaConsoleRcpFrameOpt2, in highp vec4 fxaaConsole360RcpFrameOpt2, in highp float fxaaQualitySubpix, in highp float fxaaQualityEdgeThreshold, in highp float fxaaQualityEdgeThresholdMin, in highp float fxaaConsoleEdgeSharpness, in highp float fxaaConsoleEdgeThreshold, in highp float fxaaConsoleEdgeThresholdMin, in highp vec4 fxaaConsole360ConstDir ) { highp vec2 posM; posM.x = pos.x; #line 512 posM.y = pos.y; #line 539 highp vec4 rgbyM = xll_tex2Dlod( tex, vec4( posM, 0.0, 0.0)); #line 545 highp float lumaS = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 0.0, 1.0) * fxaaQualityRcpFrame.xy)), 0.0, 0.0))); highp float lumaE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.0, 0.0) * fxaaQualityRcpFrame.xy)), 0.0, 0.0))); highp float lumaN = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 0.0, -1.0) * fxaaQualityRcpFrame.xy)), 0.0, 0.0))); highp float lumaW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.0, 0.0) * fxaaQualityRcpFrame.xy)), 0.0, 0.0))); #line 551 highp float maxSM = max( lumaS, rgbyM.w); highp float minSM = min( lumaS, rgbyM.w); highp float maxESM = max( lumaE, maxSM); highp float minESM = min( lumaE, minSM); #line 555 highp float maxWN = max( lumaN, lumaW); highp float minWN = min( lumaN, lumaW); highp float rangeMax = max( maxWN, maxESM); highp float rangeMin = min( minWN, minESM); #line 559 highp float rangeMaxScaled = (rangeMax * fxaaQualityEdgeThreshold); highp float range = (rangeMax - rangeMin); highp float rangeMaxClamped = max( fxaaQualityEdgeThresholdMin, rangeMaxScaled); bool earlyExit = (range < rangeMaxClamped); #line 564 if (earlyExit){ return rgbyM; } #line 572 highp float lumaNW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.0, -1.0) * fxaaQualityRcpFrame.xy)), 0.0, 0.0))); highp float lumaSE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.0, 1.0) * fxaaQualityRcpFrame.xy)), 0.0, 0.0))); highp float lumaNE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.0, -1.0) * fxaaQualityRcpFrame.xy)), 0.0, 0.0))); highp float lumaSW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.0, 1.0) * fxaaQualityRcpFrame.xy)), 0.0, 0.0))); #line 581 highp float lumaNS = (lumaN + lumaS); highp float lumaWE = (lumaW + lumaE); highp float subpixRcpRange = (1.0 / range); highp float subpixNSWE = (lumaNS + lumaWE); #line 585 highp float edgeHorz1 = ((-2.0 * rgbyM.w) + lumaNS); highp float edgeVert1 = ((-2.0 * rgbyM.w) + lumaWE); highp float lumaNESE = (lumaNE + lumaSE); #line 589 highp float lumaNWNE = (lumaNW + lumaNE); highp float edgeHorz2 = ((-2.0 * lumaE) + lumaNESE); highp float edgeVert2 = ((-2.0 * lumaN) + lumaNWNE); #line 593 highp float lumaNWSW = (lumaNW + lumaSW); highp float lumaSWSE = (lumaSW + lumaSE); highp float edgeHorz4 = ((abs(edgeHorz1) * 2.0) + abs(edgeHorz2)); highp float edgeVert4 = ((abs(edgeVert1) * 2.0) + abs(edgeVert2)); #line 597 highp float edgeHorz3 = ((-2.0 * lumaW) + lumaNWSW); highp float edgeVert3 = ((-2.0 * lumaS) + lumaSWSE); highp float edgeHorz = (abs(edgeHorz3) + edgeHorz4); highp float edgeVert = (abs(edgeVert3) + edgeVert4); #line 602 highp float subpixNWSWNESE = (lumaNWSW + lumaNESE); highp float lengthSign = fxaaQualityRcpFrame.x; bool horzSpan = (edgeHorz >= edgeVert); highp float subpixA = ((subpixNSWE * 2.0) + subpixNWSWNESE); #line 607 if ((!horzSpan)){ lumaN = lumaW; } if ((!horzSpan)){ lumaS = lumaE; } if (horzSpan){ lengthSign = fxaaQualityRcpFrame.y; } highp float subpixB = ((subpixA * 0.08333334) - rgbyM.w); #line 612 highp float gradientN = (lumaN - rgbyM.w); highp float gradientS = (lumaS - rgbyM.w); highp float lumaNN = (lumaN + rgbyM.w); highp float lumaSS = (lumaS + rgbyM.w); #line 616 bool pairN = (abs(gradientN) >= abs(gradientS)); highp float gradient = max( abs(gradientN), abs(gradientS)); if (pairN){ lengthSign = (-lengthSign); } highp float subpixC = xll_saturate_f((abs(subpixB) * subpixRcpRange)); #line 621 highp vec2 posB; posB.x = posM.x; posB.y = posM.y; highp vec2 offNP; #line 625 offNP.x = (( (!horzSpan) ) ? ( 0.0 ) : ( fxaaQualityRcpFrame.x )); offNP.y = (( horzSpan ) ? ( 0.0 ) : ( fxaaQualityRcpFrame.y )); if ((!horzSpan)){ posB.x += (lengthSign * 0.5); } if (horzSpan){ posB.y += (lengthSign * 0.5); } #line 630 highp vec2 posN; posN.x = (posB.x - (offNP.x * 1.0)); posN.y = (posB.y - (offNP.y * 1.0)); highp vec2 posP; #line 634 posP.x = (posB.x + (offNP.x * 1.0)); posP.y = (posB.y + (offNP.y * 1.0)); highp float subpixD = ((-2.0 * subpixC) + 3.0); highp float lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN, 0.0, 0.0))); #line 638 highp float subpixE = (subpixC * subpixC); highp float lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP, 0.0, 0.0))); if ((!pairN)){ lumaNN = lumaSS; } #line 642 highp float gradientScaled = ((gradient * 1.0) / 4.0); highp float lumaMM = (rgbyM.w - (lumaNN * 0.5)); highp float subpixF = (subpixD * subpixE); bool lumaMLTZero = (lumaMM < 0.0); #line 647 lumaEndN -= (lumaNN * 0.5); lumaEndP -= (lumaNN * 0.5); bool doneN = (abs(lumaEndN) >= gradientScaled); bool doneP = (abs(lumaEndP) >= gradientScaled); #line 651 if ((!doneN)){ posN.x -= (offNP.x * 1.0); } if ((!doneN)){ posN.y -= (offNP.y * 1.0); } bool doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 1.0); } #line 655 if ((!doneP)){ posP.y += (offNP.y * 1.0); } if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } #line 659 if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); #line 663 doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 1.0); } if ((!doneN)){ posN.y -= (offNP.y * 1.0); } doneNP = ((!doneN) || (!doneP)); #line 667 if ((!doneP)){ posP.x += (offNP.x * 1.0); } if ((!doneP)){ posP.y += (offNP.y * 1.0); } #line 671 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 675 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 1.0); } #line 679 if ((!doneN)){ posN.y -= (offNP.y * 1.0); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 1.0); } if ((!doneP)){ posP.y += (offNP.y * 1.0); } #line 685 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 689 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 1.0); } #line 693 if ((!doneN)){ posN.y -= (offNP.y * 1.0); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 1.0); } if ((!doneP)){ posP.y += (offNP.y * 1.0); } #line 699 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 703 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 1.5); } #line 707 if ((!doneN)){ posN.y -= (offNP.y * 1.5); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 1.5); } if ((!doneP)){ posP.y += (offNP.y * 1.5); } #line 713 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 717 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 2.0); } #line 721 if ((!doneN)){ posN.y -= (offNP.y * 2.0); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 2.0); } if ((!doneP)){ posP.y += (offNP.y * 2.0); } #line 727 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 731 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 2.0); } #line 735 if ((!doneN)){ posN.y -= (offNP.y * 2.0); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 2.0); } if ((!doneP)){ posP.y += (offNP.y * 2.0); } #line 741 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 745 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 2.0); } #line 749 if ((!doneN)){ posN.y -= (offNP.y * 2.0); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 2.0); } if ((!doneP)){ posP.y += (offNP.y * 2.0); } #line 755 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 759 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 2.0); } #line 763 if ((!doneN)){ posN.y -= (offNP.y * 2.0); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 2.0); } if ((!doneP)){ posP.y += (offNP.y * 2.0); } #line 769 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 773 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 4.0); } #line 777 if ((!doneN)){ posN.y -= (offNP.y * 4.0); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 4.0); } if ((!doneP)){ posP.y += (offNP.y * 4.0); } #line 783 if (doneNP){ if ((!doneN)){ lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy, 0.0, 0.0))); } if ((!doneP)){ lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy, 0.0, 0.0))); } if ((!doneN)){ lumaEndN = (lumaEndN - (lumaNN * 0.5)); } #line 787 if ((!doneP)){ lumaEndP = (lumaEndP - (lumaNN * 0.5)); } doneN = (abs(lumaEndN) >= gradientScaled); doneP = (abs(lumaEndP) >= gradientScaled); if ((!doneN)){ posN.x -= (offNP.x * 8.0); } #line 791 if ((!doneN)){ posN.y -= (offNP.y * 8.0); } doneNP = ((!doneN) || (!doneP)); if ((!doneP)){ posP.x += (offNP.x * 8.0); } if ((!doneP)){ posP.y += (offNP.y * 8.0); } } } } } } } } } } } #line 842 highp float dstN = (posM.x - posN.x); highp float dstP = (posP.x - posM.x); if ((!horzSpan)){ dstN = (posM.y - posN.y); } if ((!horzSpan)){ dstP = (posP.y - posM.y); } #line 847 bool goodSpanN = ((lumaEndN < 0.0) != lumaMLTZero); highp float spanLength = (dstP + dstN); bool goodSpanP = ((lumaEndP < 0.0) != lumaMLTZero); highp float spanLengthRcp = (1.0 / spanLength); #line 852 bool directionN = (dstN < dstP); highp float dst = min( dstN, dstP); bool goodSpan = (( directionN ) ? ( goodSpanN ) : ( goodSpanP )); highp float subpixG = (subpixF * subpixF); #line 856 highp float pixelOffset = ((dst * (-spanLengthRcp)) + 0.5); highp float subpixH = (subpixG * fxaaQualitySubpix); highp float pixelOffsetGood = (( goodSpan ) ? ( pixelOffset ) : ( 0.0 )); #line 860 highp float pixelOffsetSubpix = max( pixelOffsetGood, subpixH); if ((!horzSpan)){ posM.x += (pixelOffsetSubpix * lengthSign); } if (horzSpan){ posM.y += (pixelOffsetSubpix * lengthSign); } #line 866 return vec4( xll_tex2Dlod( tex, vec4( posM, 0.0, 0.0)).xyz, rgbyM.w); } #line 978 highp vec4 xlat_main( in v2f i ) { highp float fxaaN = 0.5; #line 982 return FxaaPixelShader( i.uv, i.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy, (_MainTex_TexelSize.xyxy * vec4( (-fxaaN), (-fxaaN), fxaaN, fxaaN)), (_MainTex_TexelSize.xyxy * vec4( -2.0, -2.0, 2.0, 2.0)), (_MainTex_TexelSize.xyxy * vec4( 8.0, 8.0, -4.0, -4.0)), 0.75, 0.166, 0.0833, 8.0, 0.125, 0.05, vec4( 1.0, -1.0, 0.25, -0.25)); } in highp vec4 xlv_SV_POSITION; in highp vec2 xlv_TEXCOORD0; in highp vec4 xlv_TEXCOORD1; void main() { highp vec4 xl_retval; v2f xlt_i; xlt_i.pos = vec4(xlv_SV_POSITION); xlt_i.uv = vec2(xlv_TEXCOORD0); xlt_i.uvPosPos = vec4(xlv_TEXCOORD1); xl_retval = xlat_main( xlt_i); gl_FragData[0] = vec4(xl_retval); } // uniforms: // _MainTex: type 25 arrsize 0 // _MainTex_TexelSize: type 12 arrsize 0