Last change
on this file was
12115,
checked in by wiesep, 6 years ago
|
Changed folder structure, deletet some unused files and cleaned up code
|
File size:
766 bytes
|
Line | |
---|
1 | //------------------------------- |
---|
2 | //BlurV_ps20.hlsl |
---|
3 | // Vertical Gaussian-Blur pass |
---|
4 | //------------------------------- |
---|
5 | |
---|
6 | sampler 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)... |
---|
11 | static const float samples[11] = |
---|
12 | {//stddev=2.0 |
---|
13 | 0.01222447, |
---|
14 | 0.02783468, |
---|
15 | 0.06559061, |
---|
16 | 0.12097757, |
---|
17 | 0.17466632, |
---|
18 | |
---|
19 | 0.19741265, |
---|
20 | |
---|
21 | 0.17466632, |
---|
22 | 0.12097757, |
---|
23 | 0.06559061, |
---|
24 | 0.02783468, |
---|
25 | 0.01222447 |
---|
26 | }; |
---|
27 | |
---|
28 | static const float2 pos[11] = |
---|
29 | { |
---|
30 | 0, -5, |
---|
31 | 0, -4, |
---|
32 | 0, -3, |
---|
33 | 0, -2, |
---|
34 | 0, -1, |
---|
35 | 0, 0, |
---|
36 | 0, 1, |
---|
37 | 0, 2, |
---|
38 | 0, 3, |
---|
39 | 0, 4, |
---|
40 | 0, 5 |
---|
41 | }; |
---|
42 | |
---|
43 | float4 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.