Functions for performing box blurs.
More...
Go to the source code of this file.
|
const float | R2_boxBlurGaussWeight2 = 0.0702702703 |
|
const float | R2_boxBlurGaussOffset2 = 3.2307692308 |
|
const float | R2_boxBlurGaussWeight1 = 0.3162162162 |
|
const float | R2_boxBlurGaussOffset1 = 1.3846153846 |
|
const float | R2_boxBlurGaussWeight0 = 0.2270270270 |
|
Functions for performing box blurs.
Definition in file R2BoxBlur.h.
§ R2_boxBlurHorizontal4f()
vec4 R2_boxBlurHorizontal4f |
( |
const sampler2D |
t, |
|
|
const vec2 |
uv, |
|
|
const float |
size |
|
) |
| |
Perform a single horizontal blur sample for texel uv in t.
- Parameters
-
t | A texture |
uv | The coordinates of the current texel |
size | The blur size |
Definition at line 61 of file R2BoxBlur.h.
66 float size_inv = 1.0 / size;
70 vec4 sum = textureLod (t, uv, 0.0) * R2_boxBlurGaussWeight0;
72 x = uv.x + (size_inv * R2_boxBlurGaussOffset1);
74 sum += textureLod (t, c, 0.0) * R2_boxBlurGaussWeight1;
76 x = uv.x + (size_inv * R2_boxBlurGaussOffset2);
78 sum += textureLod (t, c, 0.0) * R2_boxBlurGaussWeight2;
80 x = uv.x - (size_inv * R2_boxBlurGaussOffset1);
82 sum += textureLod (t, c, 0.0) * R2_boxBlurGaussWeight1;
84 x = uv.x - (size_inv * R2_boxBlurGaussOffset2);
86 sum += textureLod (t, c, 0.0) * R2_boxBlurGaussWeight2;
§ R2_boxBlurVertical4f()
vec4 R2_boxBlurVertical4f |
( |
const sampler2D |
t, |
|
|
const vec2 |
uv, |
|
|
const float |
size |
|
) |
| |
Perform a single vertical blur sample for texel uv in t.
- Parameters
-
t | A texture |
uv | The coordinates of the current texel |
size | The blur size |
Definition at line 22 of file R2BoxBlur.h.
27 float size_inv = 1.0 / size;
31 vec4 sum = textureLod (t, uv, 0.0) * R2_boxBlurGaussWeight0;
33 y = uv.y + (size_inv * R2_boxBlurGaussOffset1);
35 sum += textureLod (t, c, 0.0) * R2_boxBlurGaussWeight1;
37 y = uv.y + (size_inv * R2_boxBlurGaussOffset2);
39 sum += textureLod (t, c, 0.0) * R2_boxBlurGaussWeight2;
41 y = uv.y - (size_inv * R2_boxBlurGaussOffset1);
43 sum += textureLod (t, c, 0.0) * R2_boxBlurGaussWeight1;
45 y = uv.y - (size_inv * R2_boxBlurGaussOffset2);
47 sum += textureLod (t, c, 0.0) * R2_boxBlurGaussWeight2;