3 #define FXAA_HLSL_3 1
\r
4 #define FXAA_QUALITY__PRESET 12
\r
5 #define FXAA_EARLY_EXIT 0
\r
6 #define FXAA_GREEN_AS_LUMA 1
\r
8 #define h4tex2Dlod tex2Dlod
\r
10 #define half3 float3
\r
11 #define half2 float2
\r
14 #include "fxaa3_11.h"
\r
17 // Per fragment parameters
\r
18 float2 pos : TEXCOORD0,
\r
20 float4 fxaaConsolePosPos : TEXCOORD1,
\r
23 // Fragment program constants
\r
25 uniform float2 fxaaQualityRcpFrame,
\r
26 uniform float fxaaQualitySubpix,
\r
27 uniform float fxaaQualityEdgeThreshold,
\r
28 uniform float fxaaQualityEdgeThresholdMin,
\r
30 uniform float4 fxaaConsoleRcpFrameOpt,
\r
31 uniform float4 fxaaConsoleRcpFrameOpt2,
\r
33 uniform sampler2D nlTex0 : TEX0,
\r
36 out float4 oCol : COLOR
\r
40 oCol = FxaaPixelShader(
\r
43 fxaaQualityRcpFrame,
\r
45 fxaaQualityEdgeThreshold,
\r
46 fxaaQualityEdgeThresholdMin
\r
49 oCol = FxaaPixelShader(
\r
53 fxaaConsoleRcpFrameOpt,
\r
54 fxaaConsoleRcpFrameOpt2
\r
60 Have FXAA vertex shader run as a full screen triangle,
\r
61 and output "pos" and "fxaaConsolePosPos"
\r
62 such that inputs in the pixel shader provide,
\r
64 // {xy} = center of pixel
\r
67 // {xy__} = upper left of pixel
\r
68 // {__zw} = lower right of pixel
\r
69 FxaaFloat4 fxaaConsolePosPos,
\r
72 // fxaaConsoleRcpFrameOpt:
\r
73 // Only used on FXAA Console.
\r
74 // This must be from a constant/uniform.
\r
75 // This effects sub-pixel AA quality and inversely sharpness.
\r
76 // Where N ranges between,
\r
77 // N = 0.50 (default)
\r
78 // N = 0.33 (sharper)
\r
79 // {x___} = -N/screenWidthInPixels
\r
80 // {_y__} = -N/screenHeightInPixels
\r
81 // {__z_} = N/screenWidthInPixels
\r
82 // {___w} = N/screenHeightInPixels
\r
84 // fxaaConsoleRcpFrameOpt2:
\r
85 // Only used on FXAA Console.
\r
86 // Not used on 360, but used on PS3 and PC.
\r
87 // This must be from a constant/uniform.
\r
88 // {x___} = -2.0/screenWidthInPixels
\r
89 // {_y__} = -2.0/screenHeightInPixels
\r
90 // {__z_} = 2.0/screenWidthInPixels
\r
91 // {___w} = 2.0/screenHeightInPixels
\r