Don't draw itty-bitty particles
authorAlan Alpert <alan.alpert@nokia.com>
Thu, 15 Sep 2011 07:29:06 +0000 (17:29 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 3 Oct 2011 09:43:03 +0000 (11:43 +0200)
They look terrible when rounding errors catch up. Jerky movement and
flickering between N and N+1 square pixels when rendered.

Change-Id: Id27caa38de70a10537382962cc29a0f1254a91fc
Reviewed-on: http://codereview.qt-project.org/4949
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
src/declarative/particles/defaultshaders/imagevertex.shader

index 9967ef8..daf49fd 100644 (file)
@@ -81,6 +81,11 @@ void main() {
     else if(entry == 2.)
         currentSize = currentSize * fadeIn * fadeOut;
 
+    if(currentSize <= 0)//Sizes too small look jittery as they move
+        currentSize = 0;
+    else if(currentSize < 3)
+        currentSize = 3;
+
     highp vec2 pos;
 #ifdef DEFORM
     highp float rotation = vRotation.x + vRotation.y * t * vData.y;