boxblur: added 'repeat edge pixels' parameter
This commit is contained in:
@@ -8,6 +8,7 @@ uniform sampler2D tex_in;
|
|||||||
uniform float radius_in;
|
uniform float radius_in;
|
||||||
uniform bool horiz_in;
|
uniform bool horiz_in;
|
||||||
uniform bool vert_in;
|
uniform bool vert_in;
|
||||||
|
uniform bool repeat_edge_pixels_in;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
if (radius_in == 0.0
|
if (radius_in == 0.0
|
||||||
@@ -31,7 +32,14 @@ void main(void) {
|
|||||||
} else if (ove_iteration == 1) {
|
} else if (ove_iteration == 1) {
|
||||||
pixel_coord.y += i/ove_resolution.y;
|
pixel_coord.y += i/ove_resolution.y;
|
||||||
}
|
}
|
||||||
composite += texture2D(tex_in, pixel_coord) * divider;
|
|
||||||
|
if (repeat_edge_pixels_in
|
||||||
|
|| (pixel_coord.x >= 0.0
|
||||||
|
&& pixel_coord.x < 1.0
|
||||||
|
&& pixel_coord.y >= 0.0
|
||||||
|
&& pixel_coord.y < 1.0)) {
|
||||||
|
composite += texture2D(tex_in, pixel_coord) * divider;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gl_FragColor = composite;
|
gl_FragColor = composite;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,12 @@
|
|||||||
<default>1</default>
|
<default>1</default>
|
||||||
</param>
|
</param>
|
||||||
|
|
||||||
|
<!-- Parameter: Repeat Edge Pixels -->
|
||||||
|
<param id="repeat_edge_pixels_in" type="bool">
|
||||||
|
<name lang="en_US">Repeat Edge Pixels</name>
|
||||||
|
<default>0</default>
|
||||||
|
</param>
|
||||||
|
|
||||||
<!-- Qt Resource path to fragment shader -->
|
<!-- Qt Resource path to fragment shader -->
|
||||||
<fragment url=":/shaders/boxblur.frag"/>
|
<fragment url=":/shaders/boxblur.frag"/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user