From 105168773ddba593aef6e53d5de9e45428309532 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 12 Jan 2017 18:02:45 +0100 Subject: 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 --- examples/multimedia/video/doc/src/qmlvideofx.qdoc | 2 +- examples/multimedia/video/qmlvideofx/shaders/pagecurl.fsh | 2 +- examples/multimedia/video/qmlvideofx/shaders/ripple.fsh | 2 +- 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; -- cgit v1.2.3