summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/qmlvideofx/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/video/qmlvideofx/shaders')
-rw-r--r--examples/multimedia/video/qmlvideofx/shaders/magnify.fsh3
-rw-r--r--examples/multimedia/video/qmlvideofx/shaders/ripple.fsh3
2 files changed, 5 insertions, 1 deletions
diff --git a/examples/multimedia/video/qmlvideofx/shaders/magnify.fsh b/examples/multimedia/video/qmlvideofx/shaders/magnify.fsh
index 0387d25d6..fb7e2a047 100644
--- a/examples/multimedia/video/qmlvideofx/shaders/magnify.fsh
+++ b/examples/multimedia/video/qmlvideofx/shaders/magnify.fsh
@@ -50,12 +50,15 @@ uniform float targetWidth;
uniform float targetHeight;
uniform float posX;
uniform float posY;
+uniform float pixDens;
void main()
{
vec2 tc = qt_TexCoord0;
vec2 center = vec2(posX, posY);
vec2 xy = gl_FragCoord.xy - center.xy;
+ xy.x -= (pixDens * 14.0);
+ xy.y -= (pixDens * 29.0);
float r = sqrt(xy.x * xy.x + xy.y * xy.y);
if (r < radius) {
float h = diffractionIndex * 0.5 * radius;
diff --git a/examples/multimedia/video/qmlvideofx/shaders/ripple.fsh b/examples/multimedia/video/qmlvideofx/shaders/ripple.fsh
index b70f36d92..428c041c7 100644
--- a/examples/multimedia/video/qmlvideofx/shaders/ripple.fsh
+++ b/examples/multimedia/video/qmlvideofx/shaders/ripple.fsh
@@ -55,12 +55,13 @@ const int ITER = 7;
const float RATE = 0.1;
uniform float amplitude;
uniform float n;
+uniform float pixDens;
void main()
{
vec2 uv = qt_TexCoord0.xy;
vec2 tc = uv;
- vec2 p = vec2(-1.0 + 2.0 * gl_FragCoord.x / targetWidth, -(-1.0 + 2.0 * gl_FragCoord.y / targetHeight));
+ vec2 p = vec2(-1.0 + 2.0 * (gl_FragCoord.x - (pixDens * 14.0)) / targetWidth, -(-1.0 + 2.0 * (gl_FragCoord.y - (pixDens * 29.0)) / targetHeight));
float diffx = 0.0;
float diffy = 0.0;
vec4 col;