summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-01-12 18:02:45 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-09-08 14:48:31 +0200
commit105168773ddba593aef6e53d5de9e45428309532 (patch)
tree7ac4b6ca90069644f74e4525f9c27a5e30541924
parent6cfab288f70fb6d3dcd4f1d5c5e7da71d05c1736 (diff)
Be (somewhat more) consistent about the value of pi
Use qmath.h's value for M_PI in shaders (where we can't use M_PI itself), instead of a different hand-rolled value in each. Task-number: QTBUG-58083 Change-Id: I8d3acf0e6f46e2a8cae78c83c122e2b90db31f7c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r--examples/multimedia/video/doc/src/qmlvideofx.qdoc2
-rw-r--r--examples/multimedia/video/qmlvideofx/shaders/pagecurl.fsh2
-rw-r--r--examples/multimedia/video/qmlvideofx/shaders/ripple.fsh2
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/multimedia/video/doc/src/qmlvideofx.qdoc b/examples/multimedia/video/doc/src/qmlvideofx.qdoc
index ca0a4af9d..c52f95f44 100644
--- a/examples/multimedia/video/doc/src/qmlvideofx.qdoc
+++ b/examples/multimedia/video/doc/src/qmlvideofx.qdoc
@@ -103,7 +103,7 @@ Rectangle {
void main(void)
{
highp vec2 wiggledTexCoord = qt_TexCoord0;
- wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount;
+ wiggledTexCoord.s += sin(4.0 * 3.14159265358979323846 * wiggledTexCoord.t) * wiggleAmount;
gl_FragColor = texture2D(source, wiggledTexCoord.st);
}
"
diff --git a/examples/multimedia/video/qmlvideofx/shaders/pagecurl.fsh b/examples/multimedia/video/qmlvideofx/shaders/pagecurl.fsh
index 5f5c64935..12a5455e6 100644
--- a/examples/multimedia/video/qmlvideofx/shaders/pagecurl.fsh
+++ b/examples/multimedia/video/qmlvideofx/shaders/pagecurl.fsh
@@ -58,7 +58,7 @@ varying vec2 qt_TexCoord0;
const float minAmount = -0.16;
const float maxAmount = 1.3;
-const float PI = 3.141592653589793;
+const float PI = 3.14159265358979323846;
const float scale = 512.0;
const float sharpness = 3.0;
const vec4 bgColor = vec4(1.0, 1.0, 0.8, 1.0);
diff --git a/examples/multimedia/video/qmlvideofx/shaders/ripple.fsh b/examples/multimedia/video/qmlvideofx/shaders/ripple.fsh
index e48b7232f..aba47461f 100644
--- a/examples/multimedia/video/qmlvideofx/shaders/ripple.fsh
+++ b/examples/multimedia/video/qmlvideofx/shaders/ripple.fsh
@@ -59,7 +59,7 @@ uniform sampler2D source;
uniform lowp float qt_Opacity;
varying vec2 qt_TexCoord0;
-const float PI = 3.1415926535;
+const float PI = 3.14159265358979323846;
const int ITER = 7;
const float RATE = 0.1;
uniform float amplitude;