commit 11298b4960b63bcffd53d65102e6a4db485a8663
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Wed Jun 28 12:33:36 2017 +0100

    Rename the last 'Glow' app.

diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index 381151c..c294a50 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -46,6 +46,6 @@
         <activity android:name=".blur.BlurActivity"/>
         <activity android:name=".multiblur.MultiblurActivity"/>
         <activity android:name=".stencil.StencilActivity"/>
-        <activity android:name=".glow.GlowActivity"/>
+        <activity android:name=".movingglow.MovingGlowActivity"/>
     </application>
 </manifest>
diff --git a/src/main/java/org/distorted/examples/TableOfContents.java b/src/main/java/org/distorted/examples/TableOfContents.java
index b2de6c6..3dc6fc3 100644
--- a/src/main/java/org/distorted/examples/TableOfContents.java
+++ b/src/main/java/org/distorted/examples/TableOfContents.java
@@ -64,7 +64,7 @@ import org.distorted.examples.mirror.MirrorActivity;
 import org.distorted.examples.blur.BlurActivity;
 import org.distorted.examples.multiblur.MultiblurActivity;
 import org.distorted.examples.stencil.StencilActivity;
-import org.distorted.examples.glow.GlowActivity;
+import org.distorted.examples.movingglow.MovingGlowActivity;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -360,10 +360,10 @@ public class TableOfContents extends ListActivity
   {
       final Map<String, Object> item = new HashMap<>();
       item.put(ITEM_IMAGE, R.drawable.icon_example_glow);
-      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_glow));
-      item.put(ITEM_SUBTITLE, getText(R.string.example_glow_subtitle));
+      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_moving_glow));
+      item.put(ITEM_SUBTITLE, getText(R.string.example_moving_glow_subtitle));
       data.add(item);
-      activityMapping.put(i++, GlowActivity.class);
+      activityMapping.put(i++, MovingGlowActivity.class);
    }
 
    final SimpleAdapter dataAdapter = new SimpleAdapter(this, data, R.layout.toc_item, new String[] {ITEM_IMAGE, ITEM_TITLE, ITEM_SUBTITLE}, new int[] {R.id.Image, R.id.Title, R.id.SubTitle});
diff --git a/src/main/java/org/distorted/examples/glow/GlowActivity.java b/src/main/java/org/distorted/examples/glow/GlowActivity.java
deleted file mode 100644
index 11ac990..0000000
--- a/src/main/java/org/distorted/examples/glow/GlowActivity.java
+++ /dev/null
@@ -1,69 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Distorted.                                                               //
-//                                                                                               //
-// Distorted is free software: you can redistribute it and/or modify                             //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Distorted is distributed in the hope that it will be useful,                                  //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.examples.glow;
-
-import android.app.Activity;
-import android.os.Bundle;
-import org.distorted.library.main.Distorted;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class GlowActivity extends Activity
-{
-    private GlowSurfaceView mView;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-    @Override
-    protected void onCreate(Bundle savedState)
-      {
-      super.onCreate(savedState);
-      mView = new GlowSurfaceView(this);
-      setContentView(mView);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onPause() 
-      {
-      mView.onPause();
-      Distorted.onPause();
-      super.onPause();
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onResume() 
-      {
-      super.onResume();
-      mView.onResume();
-      }
- 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    @Override
-    protected void onDestroy() 
-      {
-      Distorted.onDestroy();  
-      super.onDestroy();
-      }
-}
diff --git a/src/main/java/org/distorted/examples/glow/GlowRenderer.java b/src/main/java/org/distorted/examples/glow/GlowRenderer.java
deleted file mode 100644
index b4f7511..0000000
--- a/src/main/java/org/distorted/examples/glow/GlowRenderer.java
+++ /dev/null
@@ -1,221 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Distorted.                                                               //
-//                                                                                               //
-// Distorted is free software: you can redistribute it and/or modify                             //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Distorted is distributed in the hope that it will be useful,                                  //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.examples.glow;
-
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.opengl.GLSurfaceView;
-
-import org.distorted.examples.R;
-import org.distorted.library.effect.EffectName;
-import org.distorted.library.effect.FragmentEffectChroma;
-import org.distorted.library.effect.MatrixEffectMove;
-import org.distorted.library.effect.MatrixEffectRotate;
-import org.distorted.library.effect.MatrixEffectScale;
-import org.distorted.library.effect.PostprocessEffectGlow;
-import org.distorted.library.main.Distorted;
-import org.distorted.library.main.DistortedEffects;
-import org.distorted.library.main.DistortedNode;
-import org.distorted.library.main.DistortedScreen;
-import org.distorted.library.main.DistortedTexture;
-import org.distorted.library.main.MeshFlat;
-import org.distorted.library.main.MeshObject;
-import org.distorted.library.message.EffectListener;
-import org.distorted.library.message.EffectMessage;
-import org.distorted.library.type.Dynamic1D;
-import org.distorted.library.type.Dynamic4D;
-import org.distorted.library.type.Static1D;
-import org.distorted.library.type.Static3D;
-import org.distorted.library.type.Static4D;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-class GlowRenderer implements GLSurfaceView.Renderer,EffectListener
-{
-   private static final int[] colors  = new int[] {0,0,1,  0,0,0,  1,0,0,  1,1,0,  0,1,0,  1,1,1}; // blue, black, red, yellow, green, white
-   private static final int LEAF_SIZE = 100;
-   private static final int NUM_LEAVES= colors.length/3;
-   
-   private GLSurfaceView mView;
-   private DistortedTexture mLeaf;
-   private DistortedScreen mScreen;
-   private DistortedEffects[] mLeafEffects = new DistortedEffects[NUM_LEAVES];
-   private PostprocessEffectGlow[] mGlow = new PostprocessEffectGlow[NUM_LEAVES];
-   private int mRootW, mRootH;
-   private int mGlowing;
-   private Static3D mMove, mScale;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   GlowRenderer(GLSurfaceView v)
-      {     
-      mView = v;
-
-      mRootW = 3*LEAF_SIZE;
-      mRootH = 3*LEAF_SIZE;
-
-      mLeaf = new DistortedTexture(LEAF_SIZE,LEAF_SIZE);
-      DistortedTexture surface = new DistortedTexture(mRootW,mRootH);
-      MeshObject mesh = new MeshFlat(1,1);
-
-      DistortedNode root = new DistortedNode(surface, new DistortedEffects(), mesh);
-     
-      Static3D moveVector = new Static3D(0,LEAF_SIZE,0);
-      Static1D chromaLevel= new Static1D(0.5f);
-      Static3D center     = new Static3D(3*LEAF_SIZE/2, 3*LEAF_SIZE/2, 0);
-      Static3D axis       = new Static3D(0,0,1);
-
-      MatrixEffectMove leafMove = new MatrixEffectMove(moveVector);
-
-      for(int j=0; j<NUM_LEAVES; j++)
-        {
-        mLeafEffects[j] = new DistortedEffects();
-        mLeafEffects[j].registerForMessages(this);
-        mLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, center) );
-        mLeafEffects[j].apply(leafMove);
-        mLeafEffects[j].apply( new FragmentEffectChroma(chromaLevel, new Static3D(colors[3*j],colors[3*j+1], colors[3*j+2])) );
-        DistortedNode node = new DistortedNode( mLeaf, mLeafEffects[j], mesh);
-        root.attach(node);
-        }
-
-      mMove = new Static3D(0,0,0);
-      mScale= new Static3D(1,1,1);
-
-      Dynamic1D rot = new Dynamic1D(5000,0.0f);
-      rot.setMode(Dynamic1D.MODE_JUMP);
-      rot.add(new Static1D(  0));
-      rot.add(new Static1D(360));
-
-      DistortedEffects effects = root.getEffects();
-      effects.apply(new MatrixEffectMove(mMove));
-      effects.apply(new MatrixEffectScale(mScale));
-      effects.apply( new MatrixEffectRotate(rot, axis, center) );
-
-      Dynamic1D radiusDyn = new Dynamic1D(3000,1.0f);
-      radiusDyn.add(new Static1D( 0));
-      radiusDyn.add(new Static1D(50));
-
-      for(int leaf=0; leaf<NUM_LEAVES; leaf++)
-        {
-        Dynamic4D color  = new Dynamic4D(5000,1.0f);
-        Static4D startC  = new Static4D(colors[3*leaf],colors[3*leaf+1], colors[3*leaf+2], 0);
-        Static4D endC    = new Static4D(colors[3*leaf],colors[3*leaf+1], colors[3*leaf+2], 1);
-        color.add(startC);
-        color.add(endC);
-
-        mGlow[leaf] = new PostprocessEffectGlow(radiusDyn,color);
-        }
-
-      makeGlow(0);
-
-      mScreen = new DistortedScreen();
-      mScreen.attach(root);
-      }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   private void makeGlow(int leaf)
-     {
-     //android.util.Log.e("glow", "glowing: "+leaf);
-
-     mGlowing = leaf;
-     mLeafEffects[leaf].apply(mGlow[leaf]);
-     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Glow finished. Make the next Leaf glow.
-
-   public void effectMessage(final EffectMessage em, final long effectID, final long objectID)
-     {
-     switch(em)
-       {
-       case EFFECT_FINISHED: //android.util.Log.e("glow", "effectMessage FINISHED");
-                             int glowing = mGlowing+1;
-                             if( glowing>=NUM_LEAVES ) glowing = 0;
-                             makeGlow(glowing);
-                             break;
-       default:              //android.util.Log.e("glow", "effectMessage REMOVED");
-                             break;
-       }
-     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   public void onDrawFrame(GL10 glUnused)
-     {
-     mScreen.render(System.currentTimeMillis());
-     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-   public void onSurfaceChanged(GL10 glUnused, int width, int height)
-     {
-     float qw = (float)width /mRootW;
-     float qh = (float)height/mRootH;
-     float factor = 0.6f* (qw<qh ? qw:qh);
-     int w = (int)(factor*mRootW);
-     int h = (int)(factor*mRootH);
-
-     mMove.set((width-w)/2 ,(height-h)/2, 0);
-     mScale.set( factor,factor,factor );
-     mScreen.resize(width, height);
-     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-   public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
-     {
-     InputStream is = mView.getContext().getResources().openRawResource(R.raw.leaf);
-     Bitmap leaf;
-      
-     try
-       {
-       leaf = BitmapFactory.decodeStream(is);
-       }
-     finally
-       {
-       try
-         {
-         is.close();
-         }
-       catch(IOException e) { }
-       }
-      
-     mLeaf.setTexture(leaf);
-
-     FragmentEffectChroma.enable();
-     PostprocessEffectGlow.enable();
-
-     try
-       {
-       Distorted.onCreate(mView.getContext());
-       }
-     catch(Exception ex)
-       {
-       android.util.Log.e("Glow", ex.getMessage() );
-       }
-     }
-}
diff --git a/src/main/java/org/distorted/examples/glow/GlowSurfaceView.java b/src/main/java/org/distorted/examples/glow/GlowSurfaceView.java
deleted file mode 100644
index b046dd1..0000000
--- a/src/main/java/org/distorted/examples/glow/GlowSurfaceView.java
+++ /dev/null
@@ -1,40 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Distorted.                                                               //
-//                                                                                               //
-// Distorted is free software: you can redistribute it and/or modify                             //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Distorted is distributed in the hope that it will be useful,                                  //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.examples.glow;
-
-import android.app.ActivityManager;
-import android.content.Context;
-import android.content.pm.ConfigurationInfo;
-import android.opengl.GLSurfaceView;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-class GlowSurfaceView extends GLSurfaceView
-{
-    public GlowSurfaceView(Context context)
-      {
-      super(context);
-      final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
-      final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
-      setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
-      setRenderer(new GlowRenderer(this));
-      }
-}
-
diff --git a/src/main/java/org/distorted/examples/movingglow/MovingGlowActivity.java b/src/main/java/org/distorted/examples/movingglow/MovingGlowActivity.java
new file mode 100644
index 0000000..53adec9
--- /dev/null
+++ b/src/main/java/org/distorted/examples/movingglow/MovingGlowActivity.java
@@ -0,0 +1,69 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Distorted.                                                               //
+//                                                                                               //
+// Distorted is free software: you can redistribute it and/or modify                             //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Distorted is distributed in the hope that it will be useful,                                  //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.examples.movingglow;
+
+import android.app.Activity;
+import android.os.Bundle;
+import org.distorted.library.main.Distorted;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class MovingGlowActivity extends Activity
+{
+    private MovingGlowSurfaceView mView;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    @Override
+    protected void onCreate(Bundle savedState)
+      {
+      super.onCreate(savedState);
+      mView = new MovingGlowSurfaceView(this);
+      setContentView(mView);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onPause() 
+      {
+      mView.onPause();
+      Distorted.onPause();
+      super.onPause();
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onResume() 
+      {
+      super.onResume();
+      mView.onResume();
+      }
+ 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+    @Override
+    protected void onDestroy() 
+      {
+      Distorted.onDestroy();  
+      super.onDestroy();
+      }
+}
diff --git a/src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java b/src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java
new file mode 100644
index 0000000..a2875bf
--- /dev/null
+++ b/src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java
@@ -0,0 +1,220 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Distorted.                                                               //
+//                                                                                               //
+// Distorted is free software: you can redistribute it and/or modify                             //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Distorted is distributed in the hope that it will be useful,                                  //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.examples.movingglow;
+
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.opengl.GLSurfaceView;
+
+import org.distorted.examples.R;
+import org.distorted.library.effect.FragmentEffectChroma;
+import org.distorted.library.effect.MatrixEffectMove;
+import org.distorted.library.effect.MatrixEffectRotate;
+import org.distorted.library.effect.MatrixEffectScale;
+import org.distorted.library.effect.PostprocessEffectGlow;
+import org.distorted.library.main.Distorted;
+import org.distorted.library.main.DistortedEffects;
+import org.distorted.library.main.DistortedNode;
+import org.distorted.library.main.DistortedScreen;
+import org.distorted.library.main.DistortedTexture;
+import org.distorted.library.main.MeshFlat;
+import org.distorted.library.main.MeshObject;
+import org.distorted.library.message.EffectListener;
+import org.distorted.library.message.EffectMessage;
+import org.distorted.library.type.Dynamic1D;
+import org.distorted.library.type.Dynamic4D;
+import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static3D;
+import org.distorted.library.type.Static4D;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class MovingGlowRenderer implements GLSurfaceView.Renderer,EffectListener
+{
+   private static final int[] colors  = new int[] {0,0,1,  0,0,0,  1,0,0,  1,1,0,  0,1,0,  1,1,1}; // blue, black, red, yellow, green, white
+   private static final int LEAF_SIZE = 100;
+   private static final int NUM_LEAVES= colors.length/3;
+   
+   private GLSurfaceView mView;
+   private DistortedTexture mLeaf;
+   private DistortedScreen mScreen;
+   private DistortedEffects[] mLeafEffects = new DistortedEffects[NUM_LEAVES];
+   private PostprocessEffectGlow[] mGlow = new PostprocessEffectGlow[NUM_LEAVES];
+   private int mRootW, mRootH;
+   private int mGlowing;
+   private Static3D mMove, mScale;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   MovingGlowRenderer(GLSurfaceView v)
+      {     
+      mView = v;
+
+      mRootW = 3*LEAF_SIZE;
+      mRootH = 3*LEAF_SIZE;
+
+      mLeaf = new DistortedTexture(LEAF_SIZE,LEAF_SIZE);
+      DistortedTexture surface = new DistortedTexture(mRootW,mRootH);
+      MeshObject mesh = new MeshFlat(1,1);
+
+      DistortedNode root = new DistortedNode(surface, new DistortedEffects(), mesh);
+     
+      Static3D moveVector = new Static3D(0,LEAF_SIZE,0);
+      Static1D chromaLevel= new Static1D(0.5f);
+      Static3D center     = new Static3D(3*LEAF_SIZE/2, 3*LEAF_SIZE/2, 0);
+      Static3D axis       = new Static3D(0,0,1);
+
+      MatrixEffectMove leafMove = new MatrixEffectMove(moveVector);
+
+      for(int j=0; j<NUM_LEAVES; j++)
+        {
+        mLeafEffects[j] = new DistortedEffects();
+        mLeafEffects[j].registerForMessages(this);
+        mLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, center) );
+        mLeafEffects[j].apply(leafMove);
+        mLeafEffects[j].apply( new FragmentEffectChroma(chromaLevel, new Static3D(colors[3*j],colors[3*j+1], colors[3*j+2])) );
+        DistortedNode node = new DistortedNode( mLeaf, mLeafEffects[j], mesh);
+        root.attach(node);
+        }
+
+      mMove = new Static3D(0,0,0);
+      mScale= new Static3D(1,1,1);
+
+      Dynamic1D rot = new Dynamic1D(5000,0.0f);
+      rot.setMode(Dynamic1D.MODE_JUMP);
+      rot.add(new Static1D(  0));
+      rot.add(new Static1D(360));
+
+      DistortedEffects effects = root.getEffects();
+      effects.apply(new MatrixEffectMove(mMove));
+      effects.apply(new MatrixEffectScale(mScale));
+      effects.apply( new MatrixEffectRotate(rot, axis, center) );
+
+      Dynamic1D radiusDyn = new Dynamic1D(3000,1.0f);
+      radiusDyn.add(new Static1D( 0));
+      radiusDyn.add(new Static1D(50));
+
+      for(int leaf=0; leaf<NUM_LEAVES; leaf++)
+        {
+        Dynamic4D color  = new Dynamic4D(5000,1.0f);
+        Static4D startC  = new Static4D(colors[3*leaf],colors[3*leaf+1], colors[3*leaf+2], 0);
+        Static4D endC    = new Static4D(colors[3*leaf],colors[3*leaf+1], colors[3*leaf+2], 1);
+        color.add(startC);
+        color.add(endC);
+
+        mGlow[leaf] = new PostprocessEffectGlow(radiusDyn,color);
+        }
+
+      makeGlow(0);
+
+      mScreen = new DistortedScreen();
+      mScreen.attach(root);
+      }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   private void makeGlow(int leaf)
+     {
+     //android.util.Log.e("glow", "glowing: "+leaf);
+
+     mGlowing = leaf;
+     mLeafEffects[leaf].apply(mGlow[leaf]);
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Glow finished. Make the next Leaf glow.
+
+   public void effectMessage(final EffectMessage em, final long effectID, final long objectID)
+     {
+     switch(em)
+       {
+       case EFFECT_FINISHED: //android.util.Log.e("glow", "effectMessage FINISHED");
+                             int glowing = mGlowing+1;
+                             if( glowing>=NUM_LEAVES ) glowing = 0;
+                             makeGlow(glowing);
+                             break;
+       default:              //android.util.Log.e("glow", "effectMessage REMOVED");
+                             break;
+       }
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   public void onDrawFrame(GL10 glUnused)
+     {
+     mScreen.render(System.currentTimeMillis());
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+   public void onSurfaceChanged(GL10 glUnused, int width, int height)
+     {
+     float qw = (float)width /mRootW;
+     float qh = (float)height/mRootH;
+     float factor = 0.6f* (qw<qh ? qw:qh);
+     int w = (int)(factor*mRootW);
+     int h = (int)(factor*mRootH);
+
+     mMove.set((width-w)/2 ,(height-h)/2, 0);
+     mScale.set( factor,factor,factor );
+     mScreen.resize(width, height);
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+   public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
+     {
+     InputStream is = mView.getContext().getResources().openRawResource(R.raw.leaf);
+     Bitmap leaf;
+      
+     try
+       {
+       leaf = BitmapFactory.decodeStream(is);
+       }
+     finally
+       {
+       try
+         {
+         is.close();
+         }
+       catch(IOException e) { }
+       }
+      
+     mLeaf.setTexture(leaf);
+
+     FragmentEffectChroma.enable();
+     PostprocessEffectGlow.enable();
+
+     try
+       {
+       Distorted.onCreate(mView.getContext());
+       }
+     catch(Exception ex)
+       {
+       android.util.Log.e("MovingGlow", ex.getMessage() );
+       }
+     }
+}
diff --git a/src/main/java/org/distorted/examples/movingglow/MovingGlowSurfaceView.java b/src/main/java/org/distorted/examples/movingglow/MovingGlowSurfaceView.java
new file mode 100644
index 0000000..9796e47
--- /dev/null
+++ b/src/main/java/org/distorted/examples/movingglow/MovingGlowSurfaceView.java
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Distorted.                                                               //
+//                                                                                               //
+// Distorted is free software: you can redistribute it and/or modify                             //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Distorted is distributed in the hope that it will be useful,                                  //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.examples.movingglow;
+
+import android.app.ActivityManager;
+import android.content.Context;
+import android.content.pm.ConfigurationInfo;
+import android.opengl.GLSurfaceView;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class MovingGlowSurfaceView extends GLSurfaceView
+{
+    public MovingGlowSurfaceView(Context context)
+      {
+      super(context);
+      final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+      final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
+      setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
+      setRenderer(new MovingGlowRenderer(this));
+      }
+}
+
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 7383b44..0374ba6 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -145,8 +145,8 @@
     <string name="example_multiblur_subtitle">Blur multiple objects which obstruct each other.</string>
     <string name="example_stencil">Stencil Buffer</string>
     <string name="example_stencil_subtitle">Implement the classic stencil example from https://open.gl/depthstencils</string>
-    <string name="example_glow">Glow Effect</string>
-    <string name="example_glow_subtitle">See objects glowing with light.</string>
+    <string name="example_moving_glow">Glow Effect</string>
+    <string name="example_moving_glow_subtitle">See moving objects glowing with light.</string>
 
     <string name="example_movingeffects_toast">Click on \'RESET\' and define your path by touching the screen. Then click on one of the effects and see it move along your path.</string>
     <string name="example_rotate_toast">Rotate the scene by swiping the screen</string>
