commit 644c21f2c771050884a5e0e56bf645b52ba85d84
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sat Feb 29 22:13:06 2020 +0000

    Moving the Vertex and Fragment centers of effect to the center of the Mesh.

diff --git a/src/main/java/org/distorted/library/effectqueue/EffectQueue.java b/src/main/java/org/distorted/library/effectqueue/EffectQueue.java
index ddfa89b..c4d304b 100644
--- a/src/main/java/org/distorted/library/effectqueue/EffectQueue.java
+++ b/src/main/java/org/distorted/library/effectqueue/EffectQueue.java
@@ -108,11 +108,11 @@ public abstract class EffectQueue implements InternalMaster.Slave
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public static void compute(EffectQueue[] queues, long currTime, float halfW, float halfH, float halfZ )
+  public static void compute(EffectQueue[] queues, long currTime)
     {
     ((EffectQueueMatrix     )queues[0]).compute(currTime);
-    ((EffectQueueVertex     )queues[1]).compute(currTime,halfW,halfH,halfZ);
-    ((EffectQueueFragment   )queues[2]).compute(currTime,halfW,halfH,halfZ);
+    ((EffectQueueVertex     )queues[1]).compute(currTime);
+    ((EffectQueueFragment   )queues[2]).compute(currTime);
     ((EffectQueuePostprocess)queues[3]).compute(currTime);
     }
 
diff --git a/src/main/java/org/distorted/library/effectqueue/EffectQueueFragment.java b/src/main/java/org/distorted/library/effectqueue/EffectQueueFragment.java
index 048c5e8..8cf411e 100644
--- a/src/main/java/org/distorted/library/effectqueue/EffectQueueFragment.java
+++ b/src/main/java/org/distorted/library/effectqueue/EffectQueueFragment.java
@@ -54,7 +54,7 @@ class EffectQueueFragment extends EffectQueue
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
   
-  void compute(long currTime,float halfX, float halfY, float halfZ)
+  void compute(long currTime)
     { 
     if( currTime==mTime ) return;
     if( mTime==0 ) mTime = currTime;
@@ -68,10 +68,6 @@ class EffectQueueFragment extends EffectQueue
         {
         EffectMessageSender.newMessage(mEffects[i]);
         }
-
-      mUniforms[NUM_UNIFORMS*i+5] -= halfX;
-      mUniforms[NUM_UNIFORMS*i+6] -= halfY;
-      mUniforms[NUM_UNIFORMS*i+7] -= halfZ;
       }
 
     mTime = currTime;  
diff --git a/src/main/java/org/distorted/library/effectqueue/EffectQueueVertex.java b/src/main/java/org/distorted/library/effectqueue/EffectQueueVertex.java
index a365cf6..ca24236 100644
--- a/src/main/java/org/distorted/library/effectqueue/EffectQueueVertex.java
+++ b/src/main/java/org/distorted/library/effectqueue/EffectQueueVertex.java
@@ -56,7 +56,7 @@ class EffectQueueVertex extends EffectQueue
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
   
-  void compute(long currTime,float halfX, float halfY, float halfZ)
+  void compute(long currTime)
     {
     if( currTime==mTime ) return;
     if( mTime==0 ) mTime = currTime;
@@ -70,10 +70,6 @@ class EffectQueueVertex extends EffectQueue
         {
         EffectMessageSender.newMessage(mEffects[i]);
         }
-
-      mUniforms[NUM_UNIFORMS*i+5] -= halfX;
-      mUniforms[NUM_UNIFORMS*i+6] -= halfY;
-      mUniforms[NUM_UNIFORMS*i+7] -= halfZ;
       }
 
     mTime = currTime;
diff --git a/src/main/java/org/distorted/library/main/DistortedLibrary.java b/src/main/java/org/distorted/library/main/DistortedLibrary.java
index 19d847c..0fb050d 100644
--- a/src/main/java/org/distorted/library/main/DistortedLibrary.java
+++ b/src/main/java/org/distorted/library/main/DistortedLibrary.java
@@ -430,13 +430,9 @@ public class DistortedLibrary
 
   static void drawPrivOIT(DistortedEffects effects, MeshBase mesh, InternalOutputSurface surface, long currTime)
     {
-    float halfX = mesh.getStretchX() / 2.0f;
-    float halfY = mesh.getStretchY() / 2.0f;
-    float halfZ = mesh.getStretchZ() / 2.0f;
-
     EffectQueue[] queues = effects.getQueues();
 
-    EffectQueue.compute(queues, currTime, halfX, halfY, halfZ );
+    EffectQueue.compute(queues, currTime);
     GLES31.glViewport(0, 0, surface.mWidth, surface.mHeight );
 
     DistortedLibrary.mMainOITProgram.useProgram();
@@ -445,6 +441,9 @@ public class DistortedLibrary
     GLES31.glUniform1ui(DistortedLibrary.mMainOITNumRecordsH, (int)(DistortedLibrary.mBufferSize*surface.mWidth*surface.mHeight) );
     mesh.bindVertexAttribs(DistortedLibrary.mMainOITProgram);
 
+    float halfX       = mesh.getStretchX() / 2.0f;
+    float halfY       = mesh.getStretchY() / 2.0f;
+    float halfZ       = mesh.getStretchZ() / 2.0f;
     float inflate     = mesh.getInflate();
     int width         = surface.mWidth;
     int height        = surface.mHeight;
@@ -467,19 +466,18 @@ public class DistortedLibrary
 
   static void drawPriv(DistortedEffects effects, MeshBase mesh, InternalOutputSurface surface, long currTime)
     {
-    float halfX = mesh.getStretchX() / 2.0f;
-    float halfY = mesh.getStretchY() / 2.0f;
-    float halfZ = mesh.getStretchZ() / 2.0f;
-
     EffectQueue[] queues = effects.getQueues();
 
-    EffectQueue.compute(queues, currTime, halfX, halfY, halfZ );
+    EffectQueue.compute(queues, currTime);
     GLES31.glViewport(0, 0, surface.mWidth, surface.mHeight );
 
     DistortedLibrary.mMainProgram.useProgram();
     GLES31.glUniform1i(DistortedLibrary.mMainTextureH, 0);
     mesh.bindVertexAttribs(DistortedLibrary.mMainProgram);
 
+    float halfX       = mesh.getStretchX() / 2.0f;
+    float halfY       = mesh.getStretchY() / 2.0f;
+    float halfZ       = mesh.getStretchZ() / 2.0f;
     float inflate     = mesh.getInflate();
     int width         = surface.mWidth;
     int height        = surface.mHeight;
