commit 678c391d74dd0fc90c3261cce8f5f986750b9998
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue May 5 13:55:59 2020 +0100

    Change the Postprocessing effects: separate the radius and the halo.
    Reason: we needed a way to specify the size of the halo around a postprocessed object; before it was automatically (and not very correctly) computed from the radius - before we knew the size of the object's bounding box, so this automatic computation was possible. Now we're removing the MashBase.getBounding(0 API, so the size of the halo has to be explicitly given by the user. This way is more correct anyway and gives the user more control (as the Multiblur app proves!)
    
    Warning: here for the first time I can see that the 2 Examples (PostprocessingTree and MovingGlow) sometimes would not appear (black screen). Maybe this commit introduces such a bug - investigate.

diff --git a/src/main/java/org/distorted/examples/blur/BlurRenderer.java b/src/main/java/org/distorted/examples/blur/BlurRenderer.java
index 8db6840..1eb55ba 100644
--- a/src/main/java/org/distorted/examples/blur/BlurRenderer.java
+++ b/src/main/java/org/distorted/examples/blur/BlurRenderer.java
@@ -24,7 +24,6 @@ import android.graphics.BitmapFactory;
 import android.opengl.GLSurfaceView;
 
 import org.distorted.examples.R;
-import org.distorted.library.effect.MatrixEffectMove;
 import org.distorted.library.effect.MatrixEffectScale;
 import org.distorted.library.effect.PostprocessEffectBlur;
 import org.distorted.library.main.DistortedLibrary;
@@ -34,8 +33,8 @@ import org.distorted.library.main.DistortedNode;
 import org.distorted.library.main.DistortedScreen;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshRectangles;
-import org.distorted.library.type.Dynamic1D;
-import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Dynamic2D;
+import org.distorted.library.type.Static2D;
 import org.distorted.library.type.Static3D;
 
 import java.io.IOException;
@@ -56,7 +55,7 @@ class BlurRenderer implements GLSurfaceView.Renderer
     private DistortedScreen mScreen;
     private DistortedFramebuffer mBuffer;
     private MeshRectangles mMesh, mMeshBuffer;
-    private Static1D mRadiusSta;
+    private Static2D mHaloRadiusSta;
     private int mObjHeight, mObjWidth;
     private Static3D mScale, mBufferScale;
 
@@ -70,9 +69,9 @@ class BlurRenderer implements GLSurfaceView.Renderer
       mScreen     = new DistortedScreen();
       mBuffer     = new DistortedFramebuffer(SIZE,SIZE,1, DistortedFramebuffer.NO_DEPTH_NO_STENCIL);
 
-      mRadiusSta = new Static1D(5);
-      Dynamic1D radiusDyn = new Dynamic1D();
-      radiusDyn.add(mRadiusSta);
+      mHaloRadiusSta = new Static2D(10,5);
+      Dynamic2D haloAndRadiusDyn = new Dynamic2D();
+      haloAndRadiusDyn.add(mHaloRadiusSta);
 
       mScale= new Static3D(1,1,1);
       mBufferScale= new Static3D(1,1,1);
@@ -81,7 +80,7 @@ class BlurRenderer implements GLSurfaceView.Renderer
       mBufferEffects.apply(new MatrixEffectScale(mBufferScale));
 
       mEffects = new DistortedEffects();
-      mEffects.apply( new PostprocessEffectBlur(radiusDyn) );
+      mEffects.apply( new PostprocessEffectBlur(haloAndRadiusDyn) );
       mEffects.apply(new MatrixEffectScale(mScale));
       }
 
@@ -90,7 +89,7 @@ class BlurRenderer implements GLSurfaceView.Renderer
    int setBlur(int blur)
      {
      int radius = blur/2;
-     mRadiusSta.set(radius);
+     mHaloRadiusSta.set1(radius);
      return radius;
      }
 
diff --git a/src/main/java/org/distorted/examples/generic/GenericEffect.java b/src/main/java/org/distorted/examples/generic/GenericEffect.java
index 6787e9f..9f102d4 100644
--- a/src/main/java/org/distorted/examples/generic/GenericEffect.java
+++ b/src/main/java/org/distorted/examples/generic/GenericEffect.java
@@ -141,8 +141,8 @@ class GenericEffect implements SeekBar.OnSeekBarChangeListener
       case CONTRAST         : effect = new FragmentEffectContrast  (mDyn1,        mCenterDyn, mRegion3Dyn, false); break;
       case SMOOTH_CONTRAST  : effect = new FragmentEffectContrast  (mDyn1,        mCenterDyn, mRegion3Dyn, true ); break;
 
-      case BLUR             : effect = new PostprocessEffectBlur   (mDyn1       ); break;
-      case GLOW             : effect = new PostprocessEffectGlow   (mDyn1, mDyn4); break;
+      case BLUR             : effect = new PostprocessEffectBlur   (mDyn2      ); break;
+      case GLOW             : effect = new PostprocessEffectGlow   (mDyn2,mDyn4); break;
       }
 
     if( effect!=null )
@@ -264,13 +264,15 @@ class GenericEffect implements SeekBar.OnSeekBarChangeListener
       // POSTPROCESS
       ///////////////////////////////////////////////////////////////////////////////////////
 
-      case BLUR             : mSta1.set(mInter[0]/2.0f);
+      case BLUR             : mSta2.set(mInter[0]/2.0f,
+                                        mInter[1]/2.0f);
                               break;
-      case GLOW             : mSta1.set(mInter[0]/2.0f);
-                              mSta4.set(mInter[1]/100.0f,
-                                        mInter[2]/100.0f,
+      case GLOW             : mSta2.set(mInter[0]/2.0f,
+                                        mInter[1]/2.0f);
+                              mSta4.set(mInter[2]/100.0f,
                                         mInter[3]/100.0f,
-                                        mInter[4]/100.0f );
+                                        mInter[4]/100.0f,
+                                        mInter[5]/100.0f );
                               break;
       }
     }
@@ -281,6 +283,7 @@ class GenericEffect implements SeekBar.OnSeekBarChangeListener
     {
     switch(mDimension)
       {
+      case 6: mInter[5] = 50;
       case 5: mInter[4] = 50;
       case 4: mInter[3] = 50;
       case 3: mInter[2] = 50;
@@ -531,6 +534,13 @@ class GenericEffect implements SeekBar.OnSeekBarChangeListener
                  mDyn1.add(mSta1);
                  }
                break;
+      case 6 : mDyn2 = new Dynamic2D();
+               mSta2 = new Static2D(0,0);
+               mDyn2.add(mSta2);
+               mDyn4 = new Dynamic4D();
+               mSta4 = new Static4D(0,0,0,0);
+               mDyn4.add(mSta4);
+               break;
       default: throw new RuntimeException("unsupported effect");
       }
 
@@ -618,6 +628,22 @@ class GenericEffect implements SeekBar.OnSeekBarChangeListener
                mSeekID[4] = seek[4].getId();
                mButton    = mEffect.findViewById(R.id.button5dRemove);
                break;
+      case 6 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect6d, null);
+               mText      = mEffect.findViewById(R.id.effect6dText);
+               seek[0]    = mEffect.findViewById(R.id.effect6dbar1);
+               seek[1]    = mEffect.findViewById(R.id.effect6dbar2);
+               seek[2]    = mEffect.findViewById(R.id.effect6dbar3);
+               seek[3]    = mEffect.findViewById(R.id.effect6dbar4);
+               seek[4]    = mEffect.findViewById(R.id.effect6dbar5);
+               seek[5]    = mEffect.findViewById(R.id.effect6dbar6);
+               mSeekID[0] = seek[0].getId();
+               mSeekID[1] = seek[1].getId();
+               mSeekID[2] = seek[2].getId();
+               mSeekID[3] = seek[3].getId();
+               mSeekID[4] = seek[4].getId();
+               mSeekID[5] = seek[5].getId();
+               mButton    = mEffect.findViewById(R.id.button6dRemove);
+               break;
       default: android.util.Log.e("GenericEffect", "dimension "+mDimension+" not supported!");
                return null;
       }
@@ -743,7 +769,7 @@ class GenericEffect implements SeekBar.OnSeekBarChangeListener
     boolean regionChanged=false;
     boolean centerChanged=false;
 
-    for(int dim=0; dim<5; dim++)
+    for(int dim=0; dim<6; dim++)
       {
       if ( mDimension>dim && bar.getId()==mSeekID[dim] )
         {
diff --git a/src/main/java/org/distorted/examples/glow/GlowRenderer.java b/src/main/java/org/distorted/examples/glow/GlowRenderer.java
index ed99cd1..f892785 100644
--- a/src/main/java/org/distorted/examples/glow/GlowRenderer.java
+++ b/src/main/java/org/distorted/examples/glow/GlowRenderer.java
@@ -32,7 +32,7 @@ import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedScreen;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshQuad;
-import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static2D;
 import org.distorted.library.type.Static3D;
 import org.distorted.library.type.Static4D;
 
@@ -47,6 +47,7 @@ import javax.microedition.khronos.opengles.GL10;
 class GlowRenderer implements GLSurfaceView.Renderer
 {
    private static final int LEAF_SIZE = 100;
+   private static final float HALO_TO_RADIUS = 0.2f;
 
    private GLSurfaceView mView;
    private DistortedTexture mLeaf;
@@ -54,7 +55,7 @@ class GlowRenderer implements GLSurfaceView.Renderer
    private PostprocessEffectGlow mGlow;
    private int mRootW, mRootH;
    private Static3D mScale;
-   private Static1D mRadius;
+   private Static2D mHaloRadius;
    private Static4D mColor;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -63,14 +64,14 @@ class GlowRenderer implements GLSurfaceView.Renderer
       {     
       mView = v;
 
-      mRootW = LEAF_SIZE;
-      mRootH = LEAF_SIZE;
-      mLeaf  = new DistortedTexture();
-      mScale = new Static3D(1,1,1);
-      mRadius= new Static1D(25);
-      mColor = new Static4D(1.0f,0.0f,0.0f,0.5f); // half-transparent red
+      mRootW     = LEAF_SIZE;
+      mRootH     = LEAF_SIZE;
+      mLeaf      = new DistortedTexture();
+      mScale     = new Static3D(1,1,1);
+      mHaloRadius= new Static2D(25*HALO_TO_RADIUS,25);
+      mColor     = new Static4D(1.0f,0.0f,0.0f,0.5f); // half-transparent red
 
-      mGlow  = new PostprocessEffectGlow(mRadius,mColor);
+      mGlow  = new PostprocessEffectGlow(mHaloRadius,mColor);
 
       DistortedEffects effects = new DistortedEffects();
       effects.apply(new MatrixEffectScale(mScale));
@@ -97,7 +98,7 @@ class GlowRenderer implements GLSurfaceView.Renderer
    int setGlowRadius(int glow)
      {
      int radius = glow/2;
-     mRadius.set(radius);
+     mHaloRadius.set(radius*HALO_TO_RADIUS,radius);
      return radius;
      }
 
diff --git a/src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java b/src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java
index db63218..5848627 100644
--- a/src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java
+++ b/src/main/java/org/distorted/examples/movingglow/MovingGlowRenderer.java
@@ -37,8 +37,10 @@ import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshQuad;
 import org.distorted.library.message.EffectListener;
 import org.distorted.library.type.Dynamic1D;
+import org.distorted.library.type.Dynamic2D;
 import org.distorted.library.type.Dynamic4D;
 import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static2D;
 import org.distorted.library.type.Static3D;
 import org.distorted.library.type.Static4D;
 
@@ -106,9 +108,9 @@ class MovingGlowRenderer implements GLSurfaceView.Renderer,EffectListener
         root.attach(node);
         }
 
-      Dynamic1D radiusDyn = new Dynamic1D(FLASH_TIME,1.0f);
-      radiusDyn.add(new Static1D( 0));
-      radiusDyn.add(new Static1D(70));
+      Dynamic2D haloAndRadiusDyn = new Dynamic2D(FLASH_TIME,1.0f);
+      haloAndRadiusDyn.add(new Static2D( 0, 0));
+      haloAndRadiusDyn.add(new Static2D(70,50));
 
       for(int leaf=0; leaf<NUM_LEAVES; leaf++)
         {
@@ -118,7 +120,7 @@ class MovingGlowRenderer implements GLSurfaceView.Renderer,EffectListener
         color.add(P1);
         color.add(P2);
 
-        mGlow[leaf] = new PostprocessEffectGlow(radiusDyn,color);
+        mGlow[leaf] = new PostprocessEffectGlow(haloAndRadiusDyn,color);
         }
 
       makeGlow(0);
@@ -161,7 +163,7 @@ class MovingGlowRenderer implements GLSurfaceView.Renderer,EffectListener
      {
      float qw = (float)width ;
      float qh = (float)height;
-     float factor = 0.9f* (qw<qh ? qw:qh);
+     float factor = 0.9f* (Math.min(qw, qh));
 
      mScale.set( factor,factor,factor );
      mScreen.resize(width, height);
diff --git a/src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java b/src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java
index c4098ae..e85b279 100644
--- a/src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java
+++ b/src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java
@@ -35,7 +35,7 @@ import org.distorted.library.main.DistortedScreen;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.effect.EffectQuality;
 import org.distorted.library.mesh.MeshCubes;
-import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static2D;
 import org.distorted.library.type.Static3D;
 import org.distorted.library.type.Static4D;
 
@@ -68,7 +68,7 @@ class MultiblurRenderer implements GLSurfaceView.Renderer
     private DistortedTexture mTex1, mTex2;
     private DistortedNode[] mNode;
     private Static3D[]  mMoveVector;
-    private Static1D  mBlurVector;
+    private Static2D mBlurHaloRadius;
     private DistortedScreen mScreen;
     private PostprocessEffectBlur mBlur;
     private int mDistance;
@@ -98,7 +98,7 @@ class MultiblurRenderer implements GLSurfaceView.Renderer
         mBlurStatus[i] = false;
         }
 
-      mBlurVector = new Static1D(10);
+      mBlurHaloRadius = new Static2D(10,2);
 
       MeshCubes mesh = new MeshCubes(1,1,1);
       mesh.setStretch(OBJ_SIZE,OBJ_SIZE,OBJ_SIZE);
@@ -118,7 +118,7 @@ class MultiblurRenderer implements GLSurfaceView.Renderer
         mScreen.attach(mNode[i]);
         }
 
-      mBlur = new PostprocessEffectBlur(mBlurVector);
+      mBlur = new PostprocessEffectBlur(mBlurHaloRadius);
       mBlurStatus[0] = true;
       effects[0].apply(mBlur);
 
@@ -163,7 +163,7 @@ class MultiblurRenderer implements GLSurfaceView.Renderer
     
     public void onSurfaceChanged(GL10 glUnused, int width, int height) 
       {
-      mScreenMin  = width<height ? width:height;
+      mScreenMin  = Math.min(width, height);
     	float factor= 0.15f*mScreenMin/OBJ_SIZE;
     	mScale.set(factor,factor,factor);
       computeMoveVectors();
@@ -232,7 +232,7 @@ class MultiblurRenderer implements GLSurfaceView.Renderer
 
     void setRange(int range)
       {
-      mBlurVector.set(range/2);
+      mBlurHaloRadius.set(range*0.2f,range*0.5f);
       }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/examples/postprocesstree/PostprocessTreeRenderer.java b/src/main/java/org/distorted/examples/postprocesstree/PostprocessTreeRenderer.java
index f559660..5d98f2a 100644
--- a/src/main/java/org/distorted/examples/postprocesstree/PostprocessTreeRenderer.java
+++ b/src/main/java/org/distorted/examples/postprocesstree/PostprocessTreeRenderer.java
@@ -36,7 +36,9 @@ import org.distorted.library.main.DistortedScreen;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshQuad;
 import org.distorted.library.type.Dynamic1D;
+import org.distorted.library.type.Dynamic2D;
 import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static2D;
 import org.distorted.library.type.Static3D;
 
 import java.io.IOException;
@@ -56,7 +58,7 @@ class PostprocessTreeRenderer implements GLSurfaceView.Renderer
    private DistortedTexture mLeaf;
    private DistortedScreen mScreen;
    private Static3D mScale;
-   private Static1D mRadius;
+   private Static2D mHaloRadius;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -67,10 +69,10 @@ class PostprocessTreeRenderer implements GLSurfaceView.Renderer
       final int OUTER = 9;
       final int INNER = 4;
 
-      mRadius = new Static1D(5);
-      Dynamic1D radiusDyn = new Dynamic1D();
-      radiusDyn.add(mRadius);
-      PostprocessEffectBlur blurEffect = new PostprocessEffectBlur(radiusDyn);
+      mHaloRadius = new Static2D(30,5);
+      Dynamic2D haloRadiusDyn = new Dynamic2D();
+      haloRadiusDyn.add(mHaloRadius);
+      PostprocessEffectBlur blurEffect = new PostprocessEffectBlur(haloRadiusDyn);
 
       mLeaf = new DistortedTexture();
       mScale= new Static3D(1,1,1);
@@ -94,8 +96,8 @@ class PostprocessTreeRenderer implements GLSurfaceView.Renderer
 
       Static3D center = new Static3D(0,0,0);
       Static3D axis   = new Static3D(0,0,1);
-      Static3D innerMoveVector = new Static3D( (1-INNER)*LEAF_SIZE/2, 0, 0);
-      Static3D outerMoveVector = new Static3D( (4-OUTER)*LEAF_SIZE/2, 0, 0);
+      Static3D innerMoveVector = new Static3D( (1-INNER)*LEAF_SIZE*0.5f, 0, 0);
+      Static3D outerMoveVector = new Static3D( (4-OUTER)*LEAF_SIZE*0.5f, 0, 0);
 
       for(int j=0; j<NUM_LEAVES; j++)
         {
@@ -135,7 +137,7 @@ class PostprocessTreeRenderer implements GLSurfaceView.Renderer
    int setBlur(int blur)
      {
      int radius = blur/2;
-     mRadius.set(radius);
+     mHaloRadius.set1(radius);
      return radius;
      }
 
@@ -152,7 +154,7 @@ class PostprocessTreeRenderer implements GLSurfaceView.Renderer
      {
      float horiRatio = (float)width ;
      float vertRatio = (float)height;
-     float factor    = horiRatio > vertRatio ? vertRatio : horiRatio;
+     float factor    = Math.min(horiRatio, vertRatio);
 
      mScale.set(factor,factor,factor);
      mScreen.resize(width, height);
diff --git a/src/main/java/org/distorted/examples/transparency/TransparencyRenderer.java b/src/main/java/org/distorted/examples/transparency/TransparencyRenderer.java
index 6a5519f..7eaaaf3 100644
--- a/src/main/java/org/distorted/examples/transparency/TransparencyRenderer.java
+++ b/src/main/java/org/distorted/examples/transparency/TransparencyRenderer.java
@@ -34,6 +34,7 @@ import org.distorted.library.main.DistortedScreen;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshRectangles;
 import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static2D;
 import org.distorted.library.type.Static3D;
 import org.distorted.library.type.Static4D;
 
@@ -105,7 +106,7 @@ class TransparencyRenderer implements GLSurfaceView.Renderer
         mTex[i]          = new DistortedTexture();
         mMoveVector[i]   = new Static3D(0,0,0);
         mAlphaVector[i]  = new Static1D(0.5f);
-        mBlur[i]         = new PostprocessEffectBlur(new Static1D(0));
+        mBlur[i]         = new PostprocessEffectBlur( new Static2D(0,5) );
         mBlurApplied[i]  = true;
         alpha[i]         = new FragmentEffectAlpha(mAlphaVector[i]);
         mEffects[i]      = new DistortedEffects();
diff --git a/src/main/java/org/distorted/examples/triblur/TriblurRenderer.java b/src/main/java/org/distorted/examples/triblur/TriblurRenderer.java
index 2fa3978..4db94c2 100644
--- a/src/main/java/org/distorted/examples/triblur/TriblurRenderer.java
+++ b/src/main/java/org/distorted/examples/triblur/TriblurRenderer.java
@@ -40,6 +40,7 @@ import org.distorted.library.main.DistortedScreen;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshCubes;
 import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static2D;
 import org.distorted.library.type.Static3D;
 import org.distorted.library.type.Static4D;
 
@@ -68,7 +69,7 @@ class TriblurRenderer implements GLSurfaceView.Renderer
     private GLSurfaceView mView;
     private DistortedTexture mTex;
     private DistortedNode[] mNode;
-    private Static1D[]  mEffectVector;
+    private Static2D[] mEffectHaloRadius;
     private DistortedScreen mScreen;
     private PostprocessEffectBlur[] mBlur;
     private PostprocessEffectGlow[] mGlow;
@@ -95,11 +96,11 @@ class TriblurRenderer implements GLSurfaceView.Renderer
       mScreen = new DistortedScreen();
       mScreen.showFPS();
 
-      mEffectStatus = new int[NUM_OBJECTS];
-      mEffectVector = new Static1D[NUM_OBJECTS];
-      mNode         = new DistortedNode[NUM_OBJECTS];
-      mBlur         = new PostprocessEffectBlur[NUM_OBJECTS];
-      mGlow         = new PostprocessEffectGlow[NUM_OBJECTS];
+      mEffectStatus    = new int[NUM_OBJECTS];
+      mEffectHaloRadius= new Static2D[NUM_OBJECTS];
+      mNode            = new DistortedNode[NUM_OBJECTS];
+      mBlur            = new PostprocessEffectBlur[NUM_OBJECTS];
+      mGlow            = new PostprocessEffectGlow[NUM_OBJECTS];
 
       FragmentEffectChroma[] chroma= new FragmentEffectChroma[NUM_OBJECTS];
       Static3D[] chromaVector      = new Static3D[NUM_OBJECTS];
@@ -119,13 +120,13 @@ class TriblurRenderer implements GLSurfaceView.Renderer
 
       for(int i=0; i<NUM_OBJECTS; i++)
         {
-        moveVector[i]    = new Static3D(OBJECTS[NUM*i  ], OBJECTS[NUM*i+1], OBJECTS[NUM*i+2]);
-        chromaVector[i]  = new Static3D(OBJECTS[NUM*i+3], OBJECTS[NUM*i+4], OBJECTS[NUM*i+5]);
-        mEffectVector[i] = new Static1D(10);
-        mBlur[i]         = new PostprocessEffectBlur(mEffectVector[i]);
-        mGlow[i]         = new PostprocessEffectGlow(mEffectVector[i], new Static4D(1.0f,1.0f,1.0f,0.5f) );
-        chroma[i]        = new FragmentEffectChroma( new Static1D(0.3f), chromaVector[i]);
-        effects[i]       = new DistortedEffects();
+        moveVector[i]       = new Static3D(OBJECTS[NUM*i  ], OBJECTS[NUM*i+1], OBJECTS[NUM*i+2]);
+        chromaVector[i]     = new Static3D(OBJECTS[NUM*i+3], OBJECTS[NUM*i+4], OBJECTS[NUM*i+5]);
+        mEffectHaloRadius[i]= new Static2D(10,10);
+        mBlur[i]            = new PostprocessEffectBlur(mEffectHaloRadius[i] );
+        mGlow[i]            = new PostprocessEffectGlow(mEffectHaloRadius[i], new Static4D(1.0f,1.0f,1.0f,0.5f) );
+        chroma[i]           = new FragmentEffectChroma( new Static1D(0.3f), chromaVector[i]);
+        effects[i]          = new DistortedEffects();
         effects[i].apply(mBlur[i]);
         effects[i].apply(chroma[i]);
       //  effects[i].apply(scaleEffectV);
@@ -213,7 +214,7 @@ class TriblurRenderer implements GLSurfaceView.Renderer
 
     public void onSurfaceChanged(GL10 glUnused, int width, int height)
       {
-      mScreenMin = width<height ? width:height;
+      mScreenMin = Math.min(width, height);
 
       float factor1 = 0.20f*mScreenMin/OBJ_SIZE;
       float factor2 = 0.75f*factor1;
@@ -228,7 +229,7 @@ class TriblurRenderer implements GLSurfaceView.Renderer
       {
       if( object>=0 && object<NUM_OBJECTS )
         {
-        mEffectVector[object].set(range / 2);
+        mEffectHaloRadius[object].set(range*0.5f,range*0.5f);
         }
       }
 
diff --git a/src/main/res/layout/effect6d.xml b/src/main/res/layout/effect6d.xml
new file mode 100644
index 0000000..9055d30
--- /dev/null
+++ b/src/main/res/layout/effect6d.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:id="@+id/effect6dLayout"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content"
+              android:orientation="vertical">
+
+        <LinearLayout
+              android:id="@+id/button6dLayout"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/effect6dText"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="5dp"
+                    android:layout_marginStart="5dp"
+                    android:layout_marginTop="3dp"
+                    android:layout_weight="1"/>
+
+                <Button
+                    android:text="@string/removebut"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:id="@+id/button6dRemove"
+                    android:layout_weight="0.2"
+                    android:layout_marginTop="3dp"/>
+        </LinearLayout>
+
+        <SeekBar
+            android:id="@+id/effect6dbar1"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="5dp"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp" />
+
+        <SeekBar
+            android:id="@+id/effect6dbar2"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="5dp"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp" />
+
+        <SeekBar
+            android:id="@+id/effect6dbar3"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="5dp"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp" />
+
+        <SeekBar
+            android:id="@+id/effect6dbar4"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="5dp"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp" />
+
+        <SeekBar
+            android:id="@+id/effect6dbar5"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="5dp"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp" />
+
+        <SeekBar
+            android:id="@+id/effect6dbar6"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="5dp"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp" />
+
+</LinearLayout>
\ No newline at end of file
