vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return textureLod( s, coord.xy, coord.w); } vec4 xll_tex2Dgrad(sampler2D s, vec2 coord, vec2 ddx, vec2 ddy) { return textureGrad( s, coord, ddx, ddy); } #line 90 #line 105 #line 120 #line 281 #line 289 #line 313 #line 468 uniform sampler2D _MainTex; uniform highp vec4 _MainTex_TexelSize; #line 289 highp vec3 FxaaFilterReturn( in highp vec3 rgb ) { #line 299 return rgb; } #line 284 highp vec3 FxaaLerp3( in highp vec3 a, in highp vec3 b, in highp float amountOfA ) { #line 285 return ((vec3( (-amountOfA), (-amountOfA), (-amountOfA)) * b) + ((a * vec3( amountOfA, amountOfA, amountOfA)) + b)); } #line 281 highp float FxaaLuma( in highp vec3 rgb ) { return ((rgb.y * 1.963211) + rgb.x); } #line 105 highp vec4 FxaaTexGrad( in sampler2D tex, in highp vec2 pos, in highp vec2 grad ) { #line 113 return xll_tex2Dgrad( tex, pos.xy, grad, grad); } #line 90 highp vec4 FxaaTexLod0( in sampler2D tex, in highp vec2 pos ) { #line 98 return xll_tex2Dlod( tex, vec4( pos.xy, 0.0, 0.0)); } #line 120 highp vec4 FxaaTexOff( in sampler2D tex, in highp vec2 pos, in highp vec2 off, in highp vec2 rcpFrame ) { #line 128 return xll_tex2Dlod( tex, vec4( (pos.xy + (off * rcpFrame)), 0.0, 0.0)); } #line 313 highp vec3 FxaaPixelShader( in highp vec2 pos, in sampler2D tex, in highp vec2 rcpFrame ) { highp vec3 rgbN = FxaaTexOff( tex, pos.xy, vec2( 0.0, -1.0), rcpFrame).xyz; #line 317 highp vec3 rgbW = FxaaTexOff( tex, pos.xy, vec2( -1.0, 0.0), rcpFrame).xyz; highp vec3 rgbM = FxaaTexOff( tex, pos.xy, vec2( 0.0, 0.0), rcpFrame).xyz; highp vec3 rgbE = FxaaTexOff( tex, pos.xy, vec2( 1.0, 0.0), rcpFrame).xyz; highp vec3 rgbS = FxaaTexOff( tex, pos.xy, vec2( 0.0, 1.0), rcpFrame).xyz; #line 321 highp float lumaN = FxaaLuma( rgbN); highp float lumaW = FxaaLuma( rgbW); highp float lumaM = FxaaLuma( rgbM); highp float lumaE = FxaaLuma( rgbE); #line 325 highp float lumaS = FxaaLuma( rgbS); highp float rangeMin = min( lumaM, min( min( lumaN, lumaW), min( lumaS, lumaE))); highp float rangeMax = max( lumaM, max( max( lumaN, lumaW), max( lumaS, lumaE))); highp float range = (rangeMax - rangeMin); #line 329 if ((range < max( 0.0625, (rangeMax * 0.125)))){ return FxaaFilterReturn( rgbM); } #line 336 highp vec3 rgbL = ((((rgbN + rgbW) + rgbM) + rgbE) + rgbS); #line 342 highp float lumaL = ((((lumaN + lumaW) + lumaE) + lumaS) * 0.25); highp float rangeL = abs((lumaL - lumaM)); #line 346 highp float blendL = (max( 0.0, ((rangeL / range) - 0.25)) * 1.333333); blendL = min( 0.75, blendL); #line 355 highp vec3 rgbNW = FxaaTexOff( tex, pos.xy, vec2( -1.0, -1.0), rcpFrame).xyz; highp vec3 rgbNE = FxaaTexOff( tex, pos.xy, vec2( 1.0, -1.0), rcpFrame).xyz; highp vec3 rgbSW = FxaaTexOff( tex, pos.xy, vec2( -1.0, 1.0), rcpFrame).xyz; highp vec3 rgbSE = FxaaTexOff( tex, pos.xy, vec2( 1.0, 1.0), rcpFrame).xyz; #line 360 rgbL += (((rgbNW + rgbNE) + rgbSW) + rgbSE); rgbL *= vec3( 0.1111111, 0.1111111, 0.1111111); highp float lumaNW = FxaaLuma( rgbNW); #line 364 highp float lumaNE = FxaaLuma( rgbNE); highp float lumaSW = FxaaLuma( rgbSW); highp float lumaSE = FxaaLuma( rgbSE); highp float edgeVert = ((abs((((0.25 * lumaNW) + (-0.5 * lumaN)) + (0.25 * lumaNE))) + abs((((0.5 * lumaW) + (-1.0 * lumaM)) + (0.5 * lumaE)))) + abs((((0.25 * lumaSW) + (-0.5 * lumaS)) + (0.25 * lumaSE)))); #line 371 highp float edgeHorz = ((abs((((0.25 * lumaNW) + (-0.5 * lumaW)) + (0.25 * lumaSW))) + abs((((0.5 * lumaN) + (-1.0 * lumaM)) + (0.5 * lumaS)))) + abs((((0.25 * lumaNE) + (-0.5 * lumaE)) + (0.25 * lumaSE)))); #line 375 bool horzSpan = (edgeHorz >= edgeVert); highp float lengthSign = (( horzSpan ) ? ( (-rcpFrame.y) ) : ( (-rcpFrame.x) )); if ((!horzSpan)){ lumaN = lumaW; } if ((!horzSpan)){ lumaS = lumaE; } #line 379 highp float gradientN = abs((lumaN - lumaM)); highp float gradientS = abs((lumaS - lumaM)); lumaN = ((lumaN + lumaM) * 0.5); lumaS = ((lumaS + lumaM) * 0.5); #line 385 bool pairN = (gradientN >= gradientS); if ((!pairN)){ lumaN = lumaS; } if ((!pairN)){ gradientN = gradientS; } if ((!pairN)){ lengthSign *= -1.0; } #line 389 highp vec2 posN; posN.x = (pos.x + (( horzSpan ) ? ( 0.0 ) : ( (lengthSign * 0.5) ))); posN.y = (pos.y + (( horzSpan ) ? ( (lengthSign * 0.5) ) : ( 0.0 ))); #line 394 gradientN *= 0.25; highp vec2 posP = posN; #line 398 highp vec2 offNP = (( horzSpan ) ? ( vec2( rcpFrame.x, 0.0) ) : ( vec2( 0.0, rcpFrame.y) )); highp float lumaEndN = lumaN; #line 402 highp float lumaEndP = lumaN; bool doneN = false; bool doneP = false; #line 415 posN += (offNP * vec2( -2.0, -2.0)); posP += (offNP * vec2( 2.0, 2.0)); offNP *= vec2( 3.0, 3.0); #line 424 highp int i = 0; for ( ; (i < 4); (i++)) { #line 431 if ((!doneN)){ lumaEndN = FxaaLuma( FxaaTexGrad( tex, posN.xy, offNP).xyz); } if ((!doneP)){ lumaEndP = FxaaLuma( FxaaTexGrad( tex, posP.xy, offNP).xyz); } #line 436 doneN = (doneN || (abs((lumaEndN - lumaN)) >= gradientN)); doneP = (doneP || (abs((lumaEndP - lumaN)) >= gradientN)); if ((doneN && doneP)){ break; } if ((!doneN)){ posN -= offNP; } #line 440 if ((!doneP)){ posP += offNP; } } highp float dstN = (( horzSpan ) ? ( (pos.x - posN.x) ) : ( (pos.y - posN.y) )); #line 444 highp float dstP = (( horzSpan ) ? ( (posP.x - pos.x) ) : ( (posP.y - pos.y) )); bool directionN = (dstN < dstP); lumaEndN = (( directionN ) ? ( lumaEndN ) : ( lumaEndP )); #line 449 if ((((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))){ lengthSign = 0.0; } #line 453 highp float spanLength = (dstP + dstN); dstN = (( directionN ) ? ( dstN ) : ( dstP )); highp float subPixelOffset = ((0.5 + (dstN * (-1.0 / spanLength))) * lengthSign); highp vec3 rgbF = FxaaTexLod0( tex, vec2( (pos.x + (( horzSpan ) ? ( 0.0 ) : ( subPixelOffset ))), (pos.y + (( horzSpan ) ? ( subPixelOffset ) : ( 0.0 ))))).xyz; #line 462 return FxaaFilterReturn( FxaaLerp3( rgbL, rgbF, blendL)); } #line 471 highp vec4 xlat_main( in highp vec2 uv ) { #line 473 return vec4( FxaaPixelShader( uv.xy, _MainTex, _MainTex_TexelSize.xy).xyz, 0.0); } in highp vec2 xlv_TEXCOORD0; void main() { highp vec4 xl_retval; xl_retval = xlat_main( vec2(xlv_TEXCOORD0)); gl_FragData[0] = vec4(xl_retval); } // uniforms: // _MainTex: type 25 arrsize 0 // _MainTex_TexelSize: type 12 arrsize 0