commit fe3cee3954c606633a88c557b5f074f83bd474b1
Author: Leszek Koltunski <leszek@distorted.org>
Date:   Fri Oct 21 22:42:25 2016 +0100

    1. Workaround for th issue that my shitty Nexus 4 crashes while compiling the vertext shader (actually the wave function)
    2. Improvements to the Dynamics app

diff --git a/src/main/res/raw/main_vertex_shader.glsl b/src/main/res/raw/main_vertex_shader.glsl
index a614279..0cc959d 100644
--- a/src/main/res/raw/main_vertex_shader.glsl
+++ b/src/main/res/raw/main_vertex_shader.glsl
@@ -462,12 +462,17 @@ void wave(in int effect, inout vec4 v, inout vec4 n)
 
       vec3 normal = cross(sx,sy);
 
-      if( normal.z > 0.0 )
-        {
-        n.x = (n.x*normal.z + n.z*normal.x);
-        n.y = (n.y*normal.z + n.z*normal.y);
-        n.z = (n.z*normal.z);
-        }
+      if( normal.z<=0.0 )                   // Why this bizarre shit rather than the straightforward
+        {                                   //
+        normal.x= 0.0;                      // if( normal.z>0.0 )
+        normal.y= 0.0;                      //   {
+        normal.z= 1.0;                      //   n.x = (n.x*normal.z + n.z*normal.x);
+        }                                   //   n.y = (n.y*normal.z + n.z*normal.y);
+                                            //   n.z = (n.z*normal.z);
+                                            //   }
+      n.x = (n.x*normal.z + n.z*normal.x);  //
+      n.y = (n.y*normal.z + n.z*normal.y);  // ? Because if we do the above, my shitty Nexus4 crashes
+      n.z = (n.z*normal.z);                 // during shader compilation!
       }
     }
   }
