From e431d97a03a7131ff327ff2cc7d12c6bad1f9fe7 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 28 Oct 2011 20:10:31 +1000 Subject: [PATCH] Clean up ImageParticle shader Avoid implicit float casts in GLSL and bail out of size == 0 properly Change-Id: I72a742697089d88c64fc05d23d3009cdcfdb480b Reviewed-by: Martin Jones --- src/declarative/particles/qquickimageparticle.cpp | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/declarative/particles/qquickimageparticle.cpp b/src/declarative/particles/qquickimageparticle.cpp index 6345280..49bdcb2 100644 --- a/src/declarative/particles/qquickimageparticle.cpp +++ b/src/declarative/particles/qquickimageparticle.cpp @@ -150,10 +150,16 @@ static const char vertexShaderCode[] = " else if (entry == 2.)\n" " currentSize = currentSize * fadeIn * fadeOut;\n" "\n" - " if (currentSize <= 0)//Sizes too small look jittery as they move\n" - " currentSize = 0;\n" - " else if (currentSize < 3)\n" - " currentSize = 3;\n" + " if (currentSize <= 0.){\n" + "#ifdef DEFORM //Not point sprites\n" + " gl_Position = qt_Matrix * vec4(vPos.x, vPos.y, 0., 1.);\n" + "#else\n" + " gl_PointSize = 0.;\n" + "#endif\n" + " return;\n" + " }\n" + " if (currentSize < 3.)//Sizes too small look jittery as they move\n" + " currentSize = 3.;\n" "\n" " highp vec2 pos;\n" "#ifdef DEFORM\n" -- 1.7.2.5