Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/data_extern/programs/Cg/BlurH_ps20.cg @ 12408

Last change on this file since 12408 was 12115, checked in by wiesep, 6 years ago

Changed folder structure, deletet some unused files and cleaned up code

File size: 775 bytes
Line 
1//-------------------------------
2//BlurH_ps20.hlsl
3// Horizontal Gaussian-Blur pass
4//-------------------------------
5
6sampler Blur0: register(s0);
7// Simple blur filter
8
9//We use the Normal-gauss distribution formula
10//f(x) being the formula, we used f(0.5)-f(-0.5); f(1.5)-f(0.5)...
11static const float samples[11] =
12{//stddev=2.0
130.01222447,
140.02783468,
150.06559061,
160.12097757,
170.17466632,
18
190.19741265,
20
210.17466632,
220.12097757,
230.06559061,
240.02783468,
250.01222447
26};
27
28static const float2 pos[11] =
29{
30-5, 0,
31-4, 0,
32-3, 0,
33-2, 0,
34-1, 0,
35 0, 0,
36 1, 0,
37 2, 0,
38 3, 0,
39 4, 0,
40 5, 0,
41};
42
43float4 main(float2 texCoord: TEXCOORD0) : COLOR
44{
45   float4 sum = 0;
46   for (int i = 0; i < 11; i++)
47   {
48      sum += tex2D(Blur0, texCoord + pos[i]*0.01) * samples[i];
49   }
50   return sum;
51}
Note: See TracBrowser for help on using the repository browser.