home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Bitfellas Bitjam
/
bitfellasbitjamcdbitfellas2007.iso
/
interface
/
intro
/
blur.ps
< prev
next >
Wrap
Text File
|
2007-08-07
|
2KB
|
34 lines
sampler2D texture1;
// z: contrast
// w: luminosity
float4 offset:register(c0);
float4 color:register(c1);
float4 main(float2 x:texcoord):color {
float4 col;
float weights[] = {
0.002216, 0.008764, 0.026995, 0.064759,
0.120985, 0.176033, 0.199471, 0.176033,
0.120985, 0.064759, 0.026995, 0.008764,
0.002216
};
float offsets[] = {
-0.0234, -0.0193, -0.0156, -0.0117,
-0.0078, -0.0031, 0.0, 0.0031, 0.0078,
0.0117, 0.0156, 0.0193, 0.0234
};
col = tex2D(texture1, x + offset.xy * offsets[0]) * weights[0];
col += tex2D(texture1, x + offset.xy * offsets[1]) * weights[1];
col += tex2D(texture1, x + offset.xy * offsets[2]) * weights[2];
col += tex2D(texture1, x + offset.xy * offsets[3]) * weights[3];
col += tex2D(texture1, x + offset.xy * offsets[4]) * weights[4];
col += tex2D(texture1, x + offset.xy * offsets[5]) * weights[5];
col += tex2D(texture1, x + offset.xy * offsets[6]) * weights[6];
col += tex2D(texture1, x + offset.xy * offsets[7]) * weights[7];
col += tex2D(texture1, x + offset.xy * offsets[8]) * weights[8];
col += tex2D(texture1, x + offset.xy * offsets[9]) * weights[9];
col += tex2D(texture1, x + offset.xy * offsets[10]) * weights[10];
col += tex2D(texture1, x + offset.xy * offsets[11]) * weights[11];
col += tex2D(texture1, x + offset.xy * offsets[12]) * weights[12];
return((col - offset.w) * color * offset.z);
}