#version 330 core
uniform sampler2D tex;
uniform int radius;
uniform float width;
uniform float height;
in vec2 uv;
out vec4 FragColor;
const float PI = 3.141592653589793;
const float sigma = 3.0f;
vec4 GaussianBlurHV()
{
float twoSigmaSqu = 2 * sigma * sigma;
int r = radius; //int(ceil(sigma * 2.57));
float allWeight = 0.0f;
vec4 col = vec4(0.0f, 0.0f, 0.0f, 0.0f);//error X3014: incorrect number of arguments to numeric-type constructor
for (int ix = -r; ix < (r + 1); ix++)
{
for (int iy = -r; iy < (r + 1); iy++)
{
float weight = 1.0f / (PI * twoSigmaSqu) * exp(-(ix * ix + iy * iy) / twoSigmaSqu);
vec2 offset = vec2(1.0f / width * ix, 1.0f / height * iy);
vec2 uv_offset = uv + offset;
uv_offset.x = clamp(uv_offset.x, 0.0f, 1.0f);
uv_offset.y = clamp(uv_offset.y, 0.0f, 1.0f);
col += texture2D(tex, uv_offset) * weight;
allWeight += weight;
}
}
col = col / allWeight;
return col;
}
I am a novice.Please do not delete my post, thank you very much
Linux archlinux 5.6.6-arch1-1
Intel® Core™ i7-6500U
NVIDIA GeForce 940M