// box blurs) until we have what we need.
unsigned mipmap_width = input_width, mipmap_height = input_height;
float adjusted_radius = radius;
// box blurs) until we have what we need.
unsigned mipmap_width = input_width, mipmap_height = input_height;
float adjusted_radius = radius;
// Find the next mipmap size (round down, minimum 1 pixel).
mipmap_width = max(mipmap_width / 2, 1u);
mipmap_height = max(mipmap_height / 2, 1u);
// Find the next mipmap size (round down, minimum 1 pixel).
mipmap_width = max(mipmap_width / 2, 1u);
mipmap_height = max(mipmap_height / 2, 1u);
ok |= hpass->set_int("height", mipmap_height);
ok |= hpass->set_int("virtual_width", mipmap_width);
ok |= hpass->set_int("virtual_height", mipmap_height);
ok |= hpass->set_int("height", mipmap_height);
ok |= hpass->set_int("virtual_width", mipmap_width);
ok |= hpass->set_int("virtual_height", mipmap_height);
ok |= vpass->set_float("radius", adjusted_radius);
ok |= vpass->set_int("width", mipmap_width);
ok |= vpass->set_int("height", mipmap_height);
ok |= vpass->set_int("virtual_width", input_width);
ok |= vpass->set_int("virtual_height", input_height);
ok |= vpass->set_float("radius", adjusted_radius);
ok |= vpass->set_int("width", mipmap_width);
ok |= vpass->set_int("height", mipmap_height);
ok |= vpass->set_int("virtual_width", input_width);
ok |= vpass->set_int("virtual_height", input_height);
register_int("height", &height);
register_int("virtual_width", &virtual_width);
register_int("virtual_height", &virtual_height);
register_int("height", &height);
register_int("virtual_width", &virtual_width);
register_int("virtual_height", &virtual_height);
- sprintf(buf, "#define DIRECTION_VERTICAL %d\n", (direction == VERTICAL));
+ sprintf(buf, "#define DIRECTION_VERTICAL %d\n#define NUM_TAPS %d\n",
+ (direction == VERTICAL), num_taps);
// Gaussian blur is a common, but maybe not the prettiest choice;
// it can feel a bit too blurry in the fine detail and too little
// long-tail. This is a simple logistic distribution, which has
// Gaussian blur is a common, but maybe not the prettiest choice;
// it can feel a bit too blurry in the fine detail and too little
// long-tail. This is a simple logistic distribution, which has
//
// We pack the parameters into a float4: The relative sample coordinates
// in (x,y), and the weight in z. w is unused.
//
// We pack the parameters into a float4: The relative sample coordinates
// in (x,y), and the weight in z. w is unused.
unsigned base_pos = i * 2 - 1;
float w1 = weight[base_pos];
float w2 = weight[base_pos + 1];
unsigned base_pos = i * 2 - 1;
float w1 = weight[base_pos];
float w2 = weight[base_pos + 1];
- set_uniform_vec2_array(glsl_program_num, prefix, "samples", samples, NUM_TAPS / 2 + 1);
+ set_uniform_vec2_array(glsl_program_num, prefix, "samples", samples, num_taps / 2 + 1);
+
+ delete[] weight;
+ delete[] samples;