Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Cg/BlurV_ps20.cg @ 12373

Last change on this file since 12373 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
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{
300, -5,
310, -4,
320, -3,
330, -2,
340, -1,
350, 0,
360, 1,
370, 2,
380, 3,
390, 4,
400, 5
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.