mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
79 lines
2.9 KiB
Text
79 lines
2.9 KiB
Text
#extension GL_ARB_shader_texture_lod : enable
|
|
uniform sampler2D _MainTex;
|
|
uniform vec4 _MainTex_TexelSize;
|
|
varying vec2 xlv_TEXCOORD0;
|
|
varying vec4 xlv_TEXCOORD1;
|
|
void main ()
|
|
{
|
|
vec4 fxaaConsoleRcpFrameOpt_1;
|
|
fxaaConsoleRcpFrameOpt_1 = (_MainTex_TexelSize.xyxy * vec4(-0.5, -0.5, 0.5, 0.5));
|
|
vec4 fxaaConsoleRcpFrameOpt2_2;
|
|
fxaaConsoleRcpFrameOpt2_2 = (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0));
|
|
vec4 tmpvar_3;
|
|
vec4 rgbyB_4;
|
|
vec4 rgbyA_5;
|
|
vec2 dir_6;
|
|
float dirSeMinusNw_7;
|
|
float lumaMaxSubMinM_8;
|
|
float dirSwMinusNe_9;
|
|
float lumaNe_10;
|
|
vec4 tmpvar_11;
|
|
tmpvar_11 = texture2DLod (_MainTex, xlv_TEXCOORD1.xy, 0.0);
|
|
vec4 tmpvar_12;
|
|
tmpvar_12 = texture2DLod (_MainTex, xlv_TEXCOORD1.xw, 0.0);
|
|
vec4 tmpvar_13;
|
|
tmpvar_13 = texture2DLod (_MainTex, xlv_TEXCOORD1.zw, 0.0);
|
|
vec4 tmpvar_14;
|
|
tmpvar_14 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0);
|
|
lumaNe_10 = (texture2DLod (_MainTex, xlv_TEXCOORD1.zy, 0.0).y + 0.00260417);
|
|
float tmpvar_15;
|
|
tmpvar_15 = max (max (lumaNe_10, tmpvar_13.y), max (tmpvar_11.y, tmpvar_12.y));
|
|
float tmpvar_16;
|
|
tmpvar_16 = min (min (lumaNe_10, tmpvar_13.y), min (tmpvar_11.y, tmpvar_12.y));
|
|
float tmpvar_17;
|
|
tmpvar_17 = max (0.05, (tmpvar_15 * 0.125));
|
|
dirSwMinusNe_9 = (tmpvar_12.y - lumaNe_10);
|
|
lumaMaxSubMinM_8 = (max (tmpvar_15, tmpvar_14.y) - min (tmpvar_16, tmpvar_14.y));
|
|
dirSeMinusNw_7 = (tmpvar_13.y - tmpvar_11.y);
|
|
if ((lumaMaxSubMinM_8 < tmpvar_17)) {
|
|
tmpvar_3 = tmpvar_14;
|
|
} else {
|
|
dir_6.x = (dirSwMinusNe_9 + dirSeMinusNw_7);
|
|
dir_6.y = (dirSwMinusNe_9 - dirSeMinusNw_7);
|
|
vec2 tmpvar_18;
|
|
tmpvar_18 = normalize(dir_6);
|
|
vec4 tmpvar_19;
|
|
tmpvar_19.zw = vec2(0.0, 0.0);
|
|
tmpvar_19.xy = (xlv_TEXCOORD0 - (tmpvar_18 * fxaaConsoleRcpFrameOpt_1.zw));
|
|
vec4 tmpvar_20;
|
|
tmpvar_20.zw = vec2(0.0, 0.0);
|
|
tmpvar_20.xy = (xlv_TEXCOORD0 + (tmpvar_18 * fxaaConsoleRcpFrameOpt_1.zw));
|
|
vec2 tmpvar_21;
|
|
tmpvar_21 = clamp ((tmpvar_18 / (
|
|
min (abs(tmpvar_18.x), abs(tmpvar_18.y))
|
|
* 8.0)), vec2(-2.0, -2.0), vec2(2.0, 2.0));
|
|
vec4 tmpvar_22;
|
|
tmpvar_22.zw = vec2(0.0, 0.0);
|
|
tmpvar_22.xy = (xlv_TEXCOORD0 - (tmpvar_21 * fxaaConsoleRcpFrameOpt2_2.zw));
|
|
vec4 tmpvar_23;
|
|
tmpvar_23.zw = vec2(0.0, 0.0);
|
|
tmpvar_23.xy = (xlv_TEXCOORD0 + (tmpvar_21 * fxaaConsoleRcpFrameOpt2_2.zw));
|
|
rgbyA_5 = (texture2DLod (_MainTex, tmpvar_19.xy, 0.0) + texture2DLod (_MainTex, tmpvar_20.xy, 0.0));
|
|
rgbyB_4 = (((texture2DLod (_MainTex, tmpvar_22.xy, 0.0) + texture2DLod (_MainTex, tmpvar_23.xy, 0.0)) * 0.25) + (rgbyA_5 * 0.25));
|
|
if (((rgbyB_4.y < tmpvar_16) || (rgbyB_4.y > tmpvar_15))) {
|
|
rgbyB_4.xyz = (rgbyA_5.xyz * 0.5);
|
|
};
|
|
tmpvar_3 = rgbyB_4;
|
|
};
|
|
gl_FragData[0] = tmpvar_3;
|
|
}
|
|
|
|
|
|
// stats: 47 alu 9 tex 2 flow
|
|
// inputs: 2
|
|
// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
|
|
// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
|
|
// uniforms: 1 (total size: 0)
|
|
// #0: _MainTex_TexelSize (high float) 4x1 [-1]
|
|
// textures: 1
|
|
// #0: _MainTex (high 2d) 0x0 [-1]
|