fixed blurs causing black frames and added backend for stabilizer
This commit is contained in:
@@ -8,7 +8,7 @@ uniform bool horiz_blur;
|
||||
uniform bool vert_blur;
|
||||
|
||||
void main(void) {
|
||||
float rad = floor(radius);
|
||||
float rad = ceil(radius);
|
||||
float x_rad = (horiz_blur) ? rad : 0.5;
|
||||
float y_rad = (vert_blur) ? rad : 0.5;
|
||||
vec2 texCoord = gl_FragCoord.xy/resolution;
|
||||
|
||||
@@ -11,12 +11,13 @@ uniform vec2 resolution;
|
||||
|
||||
void main(void) {
|
||||
if (length > 0.0) {
|
||||
float ceillen = ceil(length);
|
||||
float radians = (angle*M_PI)/180.0;
|
||||
float divider = 1.0 / length;
|
||||
float divider = 1.0 / ceillen;
|
||||
float sin_angle = sin(radians);
|
||||
float cos_angle = cos(radians);
|
||||
|
||||
for (float i=-length+0.5;i<=length;i+=2.0) {
|
||||
for (float i=-ceillen+0.5;i<=ceillen;i+=2.0) {
|
||||
float y = sin_angle * i;
|
||||
float x = cos_angle * i;
|
||||
gl_FragColor += texture2D(image, vec2(gl_FragCoord.x+x, gl_FragCoord.y+y)/resolution)*(divider);
|
||||
|
||||
@@ -24,7 +24,7 @@ void main(void) {
|
||||
if (radius == 0.0 || sigma == 0.0 || (!horiz_blur && !vert_blur)) {
|
||||
gl_FragColor = texture2D(image, gl_FragCoord.xy/resolution);
|
||||
} else {
|
||||
float rad = floor(radius);
|
||||
float rad = ceil(radius);
|
||||
float x_rad = horiz_blur ? rad : 0.5;
|
||||
float y_rad = vert_blur ? rad : 0.5;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user