0001:
0002:
0003:
0004: struct vert2frag
0005: {
0006: float4 hpos : HPOS;
0007: float4 tcoords : TEX0;
0008: };
0009:
0010:
0011:
0012: fragout main(vert2frag I
0013: , uniform texobj2D SrcTex : texunit0
0014: )
0015: {
0016: fragout O;
0017:
0018: float2 shift0 = { 0.0f/128.0f, 0.0f/128.0f };
0019: float2 shift1 = { 1.0f/128.0f, 0.0f/128.0f };
0020: float2 shift2 = { 0.0f/128.0f, 1.0f/128.0f };
0021: float2 shift3 = { -1.0f/128.0f, 0.0f/128.0f };
0022: float2 shift4 = { 0.0f/128.0f, -1.0f/128.0f };
0023:
0024: float3 tex0 = f3tex2D( SrcTex, I.tcoords.xy+shift0 );
0025: float3 tex1 = f3tex2D( SrcTex, I.tcoords.xy+shift1 );
0026: float3 tex2 = f3tex2D( SrcTex, I.tcoords.xy+shift2 );
0027: float3 tex3 = f3tex2D( SrcTex, I.tcoords.xy+shift3 );
0028: float3 tex4 = f3tex2D( SrcTex, I.tcoords.xy+shift4 );
0029:
0030: O.col.x = tex0.x + tex0.y - 0.5f;
0031: O.col.y = tex0.y
0032: + tex1.x + tex2.x + tex3.x + tex4.x - 4.0f*tex0.x;
0033: O.col.z = 0;
0034:
0035: return O;
0036: }
0037: