title: Gaussian blur shader is not blurring
body: <p>I'm trying to implement a gaussian blur shader in HLSL, the code seems correct but resulting image is all white <strong>unless</strong> I put a dirty hack by diving the result color by 1000. Even though it shows something now, it is just incorrect as colors are being changed :</p>
  
  <p><img src="https://i.stack.imgur.com/kLfGH.png" alt="enter image description here"></p>
  
  <pre><code>sampler2D input : register(s0);
  
  // new HLSL shader
  // modify the comment parameters to reflect your shader parameters
  
  /// &lt;summary&gt;Explain the purpose of this variable.&lt;/summary&gt;
  /// &lt;minValue&gt;0,0/minValue&gt;
  /// &lt;maxValue&gt;1024,1024&lt;/maxValue&gt;
  /// &lt;defaultValue&gt;599,124&lt;/defaultValue&gt;
  float2 InputSize : register(C0);
  
  const float pi = 3.141592f;
  
  float4 main(float2 uv : TEXCOORD) : COLOR 
  { 
      float4 color = tex2D( input , uv.xy); 
  
      float sigma = 1.4;
      float sigmaSq = sigma * sigma;
      int kernel = 21;
      int radius = kernel / 2;
  
      for(int i = -radius; i &lt;= radius; i++)
      {
          float x = 1.0f / radius * i;
          float xSq = x * x;
          float gb = 1.0f / sqrt(2.0f * pi * sigmaSq) * exp( -( xSq / (2.0f * sigmaSq)));
          float2 st = float2(1.0f / InputSize.x * i, 0.0f);
          float3 c = tex2D(input, uv + st).xyz;
          color.xyz += (c * gb) / 1000.0;
      }
      return color; 
  }
  </code></pre>
  
  <p>I took the formula from <a href="http://en.wikipedia.org/wiki/Gaussian_blur" rel="nofollow noreferrer">here</a> and inspired my code from <a href="https://gamedev.stackexchange.com/questions/60779/hlsl-gaussian-blur-pixelshader-blur-is-not-occurring">here</a>.</p>
  
  <p><strong>This is my reference image (made with AForge.NET with Sigma = 5 and Size = 21)</strong></p>
  
  <p><img src="https://i.stack.imgur.com/wTyS6.png" alt="enter image description here"></p>
  
  <p>Note that I did it only on the X axis compared to this image, I'm trying to make it correct first.</p>
  
  <p>And the original image if you want to try, you can paste the shader code in <a href="http://shazzam-tool.com/" rel="nofollow noreferrer">Shazzam</a>:</p>
  
  <p><img src="https://i.stack.imgur.com/ziGpo.png" alt="enter image description here"></p>