-
Notifications
You must be signed in to change notification settings - Fork 1
/
blurx.sha
31 lines (27 loc) · 1.06 KB
/
blurx.sha
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//Cg
//
//Cg profile arbvp1 arbfp1
void vshader(float4 vtx_position : POSITION,
float2 vtx_texcoord0 : TEXCOORD0,
out float4 l_position : POSITION,
out float2 l_texcoord0 : TEXCOORD0,
uniform float4x4 mat_modelproj)
{
l_position=mul(mat_modelproj, vtx_position);
l_texcoord0=vtx_texcoord0;
}
void fshader(float2 l_texcoord0 : TEXCOORD0,
out float4 o_color : COLOR,
uniform sampler2D tex_0 : TEXUNIT0)
{
float3 offset = float3(1.0/1024.0, 5.0/1024.0, 9.0/1024.0);
o_color = tex2D(tex_0, l_texcoord0) * 2;
o_color += tex2D(tex_0, float2(l_texcoord0.x - offset.z, l_texcoord0.y));
o_color += tex2D(tex_0, float2(l_texcoord0.x - offset.y, l_texcoord0.y));
o_color += tex2D(tex_0, float2(l_texcoord0.x - offset.x, l_texcoord0.y));
o_color += tex2D(tex_0, float2(l_texcoord0.x + offset.x, l_texcoord0.y));
o_color += tex2D(tex_0, float2(l_texcoord0.x + offset.y, l_texcoord0.y));
o_color += tex2D(tex_0, float2(l_texcoord0.x + offset.z, l_texcoord0.y));
o_color /= 8;
o_color.w = 1;
}