Last change
on this file since 12412 was
12115,
checked in by wiesep, 6 years ago
|
Changed folder structure, deletet some unused files and cleaned up code
|
File size:
775 bytes
|
Rev | Line | |
---|
[12115] | 1 | //------------------------------- |
---|
| 2 | //BlurH_ps20.hlsl |
---|
| 3 | // Horizontal 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 | -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 | |
---|
| 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.