commit a2878a67d2c769d160cbed0945cb903ccd949b47
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Aug 25 17:39:19 2020 +0100

    Remove the 'inflate' vertex attributs from the Mesh and file format, and replace that with a per-component 'inflate centers' (which are as of yet untested)

diff --git a/src/main/java/org/distorted/library/effect/VertexEffectQuaternion.java b/src/main/java/org/distorted/library/effect/VertexEffectQuaternion.java
index 9aedd5f..6b61893 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectQuaternion.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectQuaternion.java
@@ -78,20 +78,7 @@ public class VertexEffectQuaternion extends VertexEffect
 
      + "n.x = qw*nx + qz*ny - qy*nz - qx*nw;          \n"
      + "n.y = qw*ny - qz*nx - qy*nw + qx*nz;          \n"
-     + "n.z = qw*nz - qz*nw + qy*nx - qx*ny;          \n"
-
-     + "#ifdef PREAPPLY                                \n"
-
-     + "float ix =  - inf.z*qy + inf.y*qz + inf.x*qw;  \n"
-     + "float iy =  + inf.z*qx + inf.y*qw - inf.x*qz;  \n"
-     + "float iz =  + inf.z*qw - inf.y*qx + inf.x*qy;  \n"
-     + "float iw =  - inf.z*qz - inf.y*qy - inf.x*qx;  \n"
-
-     + "inf.x = qw*ix + qz*iy - qy*iz - qx*iw;         \n"
-     + "inf.y = qw*iy - qz*ix - qy*iw + qx*iz;         \n"
-     + "inf.z = qw*iz - qz*iw + qy*ix - qx*iy;         \n"
-
-     + "#endif                                         \n";
+     + "n.z = qw*nz - qz*nw + qy*nx - qx*ny;          \n";
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectRotate.java b/src/main/java/org/distorted/library/effect/VertexEffectRotate.java
index 677f02b..2d33748 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectRotate.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectRotate.java
@@ -95,20 +95,7 @@ public class VertexEffectRotate extends VertexEffect
 
     + "n.x = qw*nx + qz*ny - qy*nz - qx*nw;           \n"
     + "n.y = qw*ny - qz*nx - qy*nw + qx*nz;           \n"
-    + "n.z = qw*nz - qz*nw + qy*nx - qx*ny;           \n"
-
-    + "#ifdef PREAPPLY                                \n"
-
-    + "float ix =  - inf.z*qy + inf.y*qz + inf.x*qw;  \n"
-    + "float iy =  + inf.z*qx + inf.y*qw - inf.x*qz;  \n"
-    + "float iz =  + inf.z*qw - inf.y*qx + inf.x*qy;  \n"
-    + "float iw =  - inf.z*qz - inf.y*qy - inf.x*qx;  \n"
-
-    + "inf.x = qw*ix + qz*iy - qy*iz - qx*iw;         \n"
-    + "inf.y = qw*iy - qz*ix - qy*iw + qx*iz;         \n"
-    + "inf.z = qw*iz - qz*iw + qy*ix - qx*iy;         \n"
-
-    + "#endif                                         \n";
+    + "n.z = qw*nz - qz*nw + qy*nx - qx*ny;           \n";
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/library/effect/VertexEffectShear.java b/src/main/java/org/distorted/library/effect/VertexEffectShear.java
index f32c9cf..3649049 100644
--- a/src/main/java/org/distorted/library/effect/VertexEffectShear.java
+++ b/src/main/java/org/distorted/library/effect/VertexEffectShear.java
@@ -72,16 +72,7 @@ public class VertexEffectShear extends VertexEffect
     + "float new_nx = n.x - sy*n.y + sy*sz*n.z;         \n"
     + "float new_ny =-sx*n.x + tmp*(n.y - sz*n.z);      \n"
     + "n.x = new_nx;                                    \n"
-    + "n.y = new_ny;                                    \n"
-
-    + "#ifdef PREAPPLY                                  \n"
-
-    + "float new_ix = inf.x - sy*inf.y + sy*sz*inf.z;   \n"
-    + "float new_iy =-sx*inf.x + tmp*(inf.y - sz*inf.z);\n"
-    + "inf.x = new_ix;                                  \n"
-    + "inf.y = new_iy;                                  \n"
-
-    + "#endif                                           \n";
+    + "n.y = new_ny;                                    \n";
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/library/main/DistortedLibrary.java b/src/main/java/org/distorted/library/main/DistortedLibrary.java
index 0a1347d..338408c 100644
--- a/src/main/java/org/distorted/library/main/DistortedLibrary.java
+++ b/src/main/java/org/distorted/library/main/DistortedLibrary.java
@@ -347,7 +347,7 @@ public class DistortedLibrary
 
     fullVertHeader += "#define PREAPPLY\n";
 
-    String[] feedback = { "v_Position", "v_endPosition", "v_Inflate" };
+    String[] feedback = { "v_Position", "v_endPosition" };
 
     try
       {
diff --git a/src/main/java/org/distorted/library/mesh/AssociationUniformBlock.java b/src/main/java/org/distorted/library/mesh/AssociationUniformBlock.java
deleted file mode 100644
index 0fb489f..0000000
--- a/src/main/java/org/distorted/library/mesh/AssociationUniformBlock.java
+++ /dev/null
@@ -1,95 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2020 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.library.mesh;
-
-import android.opengl.GLES30;
-
-import org.distorted.library.main.InternalBuffer;
-
-import static org.distorted.library.mesh.MeshBase.MAX_EFFECT_COMPONENTS;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-class AssociationUniformBlock
-  {
-  private static final int ASSOCIATION_SIZE = 16*MAX_EFFECT_COMPONENTS;
-  private static final int DEFAULT_ASSOCIATION = 0xffffffff;
-
-  private InternalBuffer mUBO;
-  private int[] mAssociations;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  AssociationUniformBlock()
-    {
-    mAssociations= new int[ASSOCIATION_SIZE/4];
-
-    for(int i=0; i<MAX_EFFECT_COMPONENTS; i++)
-      {
-      mAssociations[4*i  ] = DEFAULT_ASSOCIATION;
-      mAssociations[4*i+2] = i;
-      }
-
-    mUBO = new InternalBuffer(GLES30.GL_UNIFORM_BUFFER, GLES30.GL_STATIC_READ);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  AssociationUniformBlock( AssociationUniformBlock original)
-    {
-    int size = original.mAssociations.length;
-    mAssociations= new int[size];
-    System.arraycopy(original.mAssociations, 0, mAssociations, 0, size);
-
-    mUBO = new InternalBuffer(GLES30.GL_UNIFORM_BUFFER, GLES30.GL_STATIC_READ);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   boolean matchesAssociation( int comp, int andAssoc, int equAssoc)
-     {
-     return (andAssoc & mAssociations[4*comp]) != 0 || (equAssoc == mAssociations[4*comp+2]);
-     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   void setEffectAssociationNow(int comp, int andAssociation, int equAssociation)
-     {
-     mAssociations[4*comp  ] = andAssociation;
-     mAssociations[4*comp+2] = equAssociation;
-
-     mUBO.invalidate();
-     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   int getIndex()
-     {
-     return mUBO.createImmediatelyInt( ASSOCIATION_SIZE, mAssociations);
-     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-   void copy( int compTo, AssociationUniformBlock assocFrom, int compFrom)
-     {
-     mAssociations[4*compTo  ] = assocFrom.mAssociations[4*compFrom  ];
-     mAssociations[4*compTo+2] = assocFrom.mAssociations[4*compFrom+2];
-     }
-  }
diff --git a/src/main/java/org/distorted/library/mesh/MeshBase.java b/src/main/java/org/distorted/library/mesh/MeshBase.java
index f18c358..500b8ee 100644
--- a/src/main/java/org/distorted/library/mesh/MeshBase.java
+++ b/src/main/java/org/distorted/library/mesh/MeshBase.java
@@ -46,31 +46,29 @@ import java.util.ArrayList;
  */
 public abstract class MeshBase
    {
-   private static final int UBO_BINDING = 3;
+   private static final int ASSOC_UBO_BINDING  = 3;
+   private static final int CENTER_UBO_BINDING = 4;
            static final int MAX_EFFECT_COMPONENTS= 100;
 
    // sizes of attributes of an individual vertex.
    private static final int POS_DATA_SIZE= 3; // vertex coordinates: x,y,z
    private static final int NOR_DATA_SIZE= 3; // normal vector: x,y,z
-   private static final int INF_DATA_SIZE= 3; // 'inflate' vector: x,y,z
    private static final int TEX_DATA_SIZE= 2; // texture coordinates: s,t
    private static final int COM_DATA_SIZE= 1; // component number, a single float
 
    static final int POS_ATTRIB   = 0;
    static final int NOR_ATTRIB   = POS_DATA_SIZE;
-   static final int INF_ATTRIB   = POS_DATA_SIZE + NOR_DATA_SIZE;
    static final int TEX_ATTRIB   = 0;
    static final int COM_ATTRIB   = TEX_DATA_SIZE;
 
-   static final int VERT1_ATTRIBS= POS_DATA_SIZE + NOR_DATA_SIZE + INF_DATA_SIZE;  // number of attributes of a vertex (the part changed by preapply)
-   static final int VERT2_ATTRIBS= TEX_DATA_SIZE + COM_DATA_SIZE;                  // number of attributes of a vertex (the 'preapply invariant' part)
-   static final int TRAN_ATTRIBS = POS_DATA_SIZE + NOR_DATA_SIZE + INF_DATA_SIZE;  // number of attributes of a transform feedback vertex
+   static final int VERT1_ATTRIBS= POS_DATA_SIZE + NOR_DATA_SIZE;  // number of attributes of a vertex (the part changed by preapply)
+   static final int VERT2_ATTRIBS= TEX_DATA_SIZE + COM_DATA_SIZE;  // number of attributes of a vertex (the 'preapply invariant' part)
+   static final int TRAN_ATTRIBS = POS_DATA_SIZE + NOR_DATA_SIZE;  // number of attributes of a transform feedback vertex
 
    private static final int BYTES_PER_FLOAT = 4;
 
    private static final int OFFSET_POS = POS_ATTRIB*BYTES_PER_FLOAT;
    private static final int OFFSET_NOR = NOR_ATTRIB*BYTES_PER_FLOAT;
-   private static final int OFFSET_INF = INF_ATTRIB*BYTES_PER_FLOAT;
    private static final int OFFSET_TEX = TEX_ATTRIB*BYTES_PER_FLOAT;
    private static final int OFFSET_COM = COM_ATTRIB*BYTES_PER_FLOAT;
 
@@ -81,14 +79,15 @@ public abstract class MeshBase
    private boolean mShowNormals;              // when rendering this mesh, draw normal vectors?
    private InternalBuffer mVBO1, mVBO2, mTFO; // main vertex buffer and transform feedback buffer
    private int mNumVertices;
-   private float[] mVertAttribs1;             // packed: PosX,PosY,PosZ, NorX,NorY,NorZ, InfX,InfY,InfZ
+   private float[] mVertAttribs1;             // packed: PosX,PosY,PosZ, NorX,NorY,NorZ
    private float[] mVertAttribs2;             // packed: TexS,TexT, Component
    private float mInflate;
-   private AssociationUniformBlock mAUB;
+   private UniformBlockAssociation mUBA;
+   private UniformBlockCenter mUBC;
 
    DeferredJobs.JobNode[] mJobNode;
 
-   private static final int TEX_COMP_SIZE = 5; // 5 four-bytes entities inside the component
+   private static final int TEX_COMP_SIZE = 5; // 5 four-byte entities inside the component
 
    private static class TexComponent
      {
@@ -131,7 +130,8 @@ public abstract class MeshBase
 
      mJobNode = new DeferredJobs.JobNode[1];
 
-     mAUB = new AssociationUniformBlock();
+     mUBA = new UniformBlockAssociation();
+     mUBC = new UniformBlockCenter();
 
      mVBO1= new InternalBuffer(GLES30.GL_ARRAY_BUFFER             , GLES30.GL_STATIC_READ);
      mVBO2= new InternalBuffer(GLES30.GL_ARRAY_BUFFER             , GLES30.GL_STATIC_READ);
@@ -147,7 +147,8 @@ public abstract class MeshBase
      mInflate    = original.mInflate;
      mNumVertices= original.mNumVertices;
 
-     mAUB = new AssociationUniformBlock(original.mAUB);
+     mUBA = new UniformBlockAssociation(original.mUBA);
+     mUBC = new UniformBlockCenter(original.mUBC);
 
      if( deep )
        {
@@ -254,7 +255,7 @@ public abstract class MeshBase
        start = end+1;
        end   = mEffComponent.get(comp);
 
-       if( mAUB.matchesAssociation(comp, andAssoc, equAssoc) )
+       if( mUBA.matchesAssociation(comp, andAssoc, equAssoc) )
          {
          applyMatrixToComponent(matrixP, matrixV, start, end);
          }
@@ -299,27 +300,6 @@ public abstract class MeshBase
          mVertAttribs1[index+NOR_ATTRIB+1] /= len1;
          mVertAttribs1[index+NOR_ATTRIB+2] /= len1;
          }
-
-       x = mVertAttribs1[index+INF_ATTRIB  ];
-       y = mVertAttribs1[index+INF_ATTRIB+1];
-       z = mVertAttribs1[index+INF_ATTRIB+2];
-
-       mVertAttribs1[index+INF_ATTRIB  ] = matrixV[0]*x + matrixV[4]*y + matrixV[ 8]*z;
-       mVertAttribs1[index+INF_ATTRIB+1] = matrixV[1]*x + matrixV[5]*y + matrixV[ 9]*z;
-       mVertAttribs1[index+INF_ATTRIB+2] = matrixV[2]*x + matrixV[6]*y + matrixV[10]*z;
-
-       x = mVertAttribs1[index+INF_ATTRIB  ];
-       y = mVertAttribs1[index+INF_ATTRIB+1];
-       z = mVertAttribs1[index+INF_ATTRIB+2];
-
-       float len2 = (float)Math.sqrt(x*x + y*y + z*z);
-
-       if( len2>0.0f )
-         {
-         mVertAttribs1[index+INF_ATTRIB  ] /= len2;
-         mVertAttribs1[index+INF_ATTRIB+1] /= len2;
-         mVertAttribs1[index+INF_ATTRIB+2] /= len2;
-         }
        }
      }
 
@@ -327,7 +307,14 @@ public abstract class MeshBase
 
    void setEffectAssociationNow(int component, int andAssociation, int equAssociation)
      {
-     mAUB.setEffectAssociationNow(component, andAssociation, equAssociation);
+     mUBA.setEffectAssociationNow(component, andAssociation, equAssociation);
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   void setEffectCenterNow(int component, float x, float y, float z)
+     {
+     mUBC.setEffectCenterNow(component, x, y, z);
      }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -393,7 +380,8 @@ public abstract class MeshBase
 
          if( origEffComponents<MAX_EFFECT_COMPONENTS )
            {
-           mAUB.copy(origEffComponents, mesh.mAUB, j);
+           mUBA.copy(origEffComponents, mesh.mUBA, j);
+           mUBC.copy(origEffComponents, mesh.mUBC, j);
            origEffComponents++;
            }
          }
@@ -690,9 +678,13 @@ public abstract class MeshBase
  */
    public void send(int programH)
      {
-     int index = mAUB.getIndex();
-     GLES30.glBindBufferBase(GLES30.GL_UNIFORM_BUFFER, UBO_BINDING, index);
-     GLES30.glUniformBlockBinding(programH, UBO_BINDING, index);
+     int indexA = mUBA.getIndex();
+     GLES30.glBindBufferBase(GLES30.GL_UNIFORM_BUFFER, ASSOC_UBO_BINDING, indexA);
+     GLES30.glUniformBlockBinding(programH, ASSOC_UBO_BINDING, indexA);
+
+     int indexC = mUBC.getIndex();
+     GLES30.glBindBufferBase(GLES30.GL_UNIFORM_BUFFER, CENTER_UBO_BINDING, indexC);
+     GLES30.glUniformBlockBinding(programH, CENTER_UBO_BINDING, indexC);
      }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -727,10 +719,9 @@ public abstract class MeshBase
      GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, index1 );
      GLES30.glVertexAttribPointer(program.mAttribute[0], POS_DATA_SIZE, GLES30.GL_FLOAT, false, VERT1_SIZE, OFFSET_POS);
      GLES30.glVertexAttribPointer(program.mAttribute[1], NOR_DATA_SIZE, GLES30.GL_FLOAT, false, VERT1_SIZE, OFFSET_NOR);
-     GLES30.glVertexAttribPointer(program.mAttribute[2], INF_DATA_SIZE, GLES30.GL_FLOAT, false, VERT1_SIZE, OFFSET_INF);
      GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, index2 );
-     GLES30.glVertexAttribPointer(program.mAttribute[3], TEX_DATA_SIZE, GLES30.GL_FLOAT, false, VERT2_SIZE, OFFSET_TEX);
-     GLES30.glVertexAttribPointer(program.mAttribute[4], COM_DATA_SIZE, GLES30.GL_FLOAT, false, VERT2_SIZE, OFFSET_COM);
+     GLES30.glVertexAttribPointer(program.mAttribute[2], TEX_DATA_SIZE, GLES30.GL_FLOAT, false, VERT2_SIZE, OFFSET_TEX);
+     GLES30.glVertexAttribPointer(program.mAttribute[3], COM_DATA_SIZE, GLES30.GL_FLOAT, false, VERT2_SIZE, OFFSET_COM);
      GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, 0);
      }
 
@@ -786,7 +777,7 @@ public abstract class MeshBase
 
        version = byteBuf.getInt(0);
 
-       if( version==1 )
+       if( version==1 || version==2 )
          {
          mNumVertices= byteBuf.getInt(4);
          numTex      = byteBuf.getInt(8);
@@ -811,7 +802,10 @@ public abstract class MeshBase
        mVertAttribs1 = new float[VERT1_ATTRIBS*mNumVertices];
        mVertAttribs2 = new float[VERT2_ATTRIBS*mNumVertices];
 
-       buffer = new byte[BYTES_PER_FLOAT*(size + mNumVertices*(VERT1_ATTRIBS+VERT2_ATTRIBS))];
+       // version 1 had extra 3 floats (the 'inflate' vector) in its vert1 array
+       int vert1InFile = version==1 ? VERT1_ATTRIBS+3 : VERT1_ATTRIBS;
+
+       buffer = new byte[BYTES_PER_FLOAT*(size + mNumVertices*(vert1InFile+VERT2_ATTRIBS))];
 
        try
          {
@@ -827,7 +821,29 @@ public abstract class MeshBase
        FloatBuffer floatBuf = byteBuf.asFloatBuffer();
 
        floatBuf.get(tmp,0,size);
-       floatBuf.get(mVertAttribs1, 0, VERT1_ATTRIBS*mNumVertices);
+
+       switch(version)
+         {
+         case 1 : int index = floatBuf.position();
+
+                  for(int vert=0; vert<mNumVertices; vert++)
+                    {
+                    mVertAttribs1[VERT1_ATTRIBS*vert+POS_ATTRIB  ] = floatBuf.get(index+POS_ATTRIB  );
+                    mVertAttribs1[VERT1_ATTRIBS*vert+POS_ATTRIB+1] = floatBuf.get(index+POS_ATTRIB+1);
+                    mVertAttribs1[VERT1_ATTRIBS*vert+POS_ATTRIB+2] = floatBuf.get(index+POS_ATTRIB+2);
+                    mVertAttribs1[VERT1_ATTRIBS*vert+NOR_ATTRIB  ] = floatBuf.get(index+NOR_ATTRIB  );
+                    mVertAttribs1[VERT1_ATTRIBS*vert+NOR_ATTRIB+1] = floatBuf.get(index+NOR_ATTRIB+1);
+                    mVertAttribs1[VERT1_ATTRIBS*vert+NOR_ATTRIB+2] = floatBuf.get(index+NOR_ATTRIB+2);
+                    index+=vert1InFile;
+                    }
+                  floatBuf.position(index);
+                  break;
+         case 2 : floatBuf.get(mVertAttribs1, 0, VERT1_ATTRIBS*mNumVertices);
+                  break;
+         default: android.util.Log.e("mesh", "Error: unknown mesh file version "+String.format("0x%08X", version));
+                  return 0;
+         }
+
        floatBuf.get(mVertAttribs2, 0, VERT2_ATTRIBS*mNumVertices);
 
        TexComponent tex;
@@ -902,7 +918,7 @@ public abstract class MeshBase
 
      try
        {
-       stream.writeInt(1);  // version
+       stream.writeInt(2);  // version
        stream.writeInt(mNumVertices);
        stream.writeInt(numTex);
        stream.writeInt(numEff);
@@ -1152,7 +1168,7 @@ public abstract class MeshBase
  * Copy the Mesh.
  *
  * @param deep If to be a deep or shallow copy of mVertAttribs1, i.e. the array holding vertices,
- *             normals and inflates (the rest, in particular the mVertAttribs2 containing texture
+ *             and normals (the rest, in particular the mVertAttribs2 containing texture
  *             coordinates and effect associations, is always deep copied)
  */
    public abstract MeshBase copy(boolean deep);
diff --git a/src/main/java/org/distorted/library/mesh/MeshCubes.java b/src/main/java/org/distorted/library/mesh/MeshCubes.java
index ff29fa8..fee1920 100644
--- a/src/main/java/org/distorted/library/mesh/MeshCubes.java
+++ b/src/main/java/org/distorted/library/mesh/MeshCubes.java
@@ -628,10 +628,6 @@ public class MeshCubes extends MeshBase
      attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+1] = mNormalY[index];
      attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+2] = mNormalZ[index];
 
-     attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
-     attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
-     attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+2] = vectZ;
-
      if( vectZ>0 )
        {
        attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB  ] = mTexMappingX[FRONT] +       x  * mTexMappingW[FRONT];
@@ -669,10 +665,6 @@ public class MeshCubes extends MeshBase
                    attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+1] = 1.0f;
                    attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+2] = (slice==0 ? R : (slice==mSlices ? -R:0) );
 
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+2] = z;
-
                    attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB  ] = mTexMappingX[TOP] +       x  * mTexMappingW[TOP];
                    attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB+1] = mTexMappingY[TOP] + (0.5f-z) * mTexMappingH[TOP];
 
@@ -691,10 +683,6 @@ public class MeshCubes extends MeshBase
                    attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+1] =-1.0f;
                    attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+2] = (slice==0 ? R : (slice==mSlices ? -R:0) );
 
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+2] = z;
-
                    attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB  ] = mTexMappingX[BOTTOM] +       x  * mTexMappingW[BOTTOM];
                    attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB+1] = mTexMappingY[BOTTOM] + (0.5f-z) * mTexMappingH[BOTTOM];
 
@@ -713,10 +701,6 @@ public class MeshCubes extends MeshBase
                    attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+1] = side==WEST ? 0.0f : (side==NORTH?-R:R);
                    attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+2] = (slice==0 ? R : (slice==mSlices ? -R:0) );
 
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+2] = z;
-
                    attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB  ] = mTexMappingX[LEFT] + (0.5f-z) * mTexMappingW[LEFT];
                    attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB+1] = mTexMappingY[LEFT] + (1.0f-y) * mTexMappingH[LEFT];
 
@@ -735,10 +719,6 @@ public class MeshCubes extends MeshBase
                    attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+1] = side==EAST ? 0.0f : (side==SOUTH?-R:R);
                    attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+2] = (slice==0 ? R : (slice==mSlices ? -R:0) );
 
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
-                   attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+2] = z;
-
                    attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB  ] = mTexMappingX[RIGHT] + (0.5f-z) * mTexMappingW[RIGHT];
                    attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB+1] = mTexMappingY[RIGHT] + (1.0f-y) * mTexMappingH[RIGHT];
 
@@ -760,10 +740,6 @@ public class MeshCubes extends MeshBase
      attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+1] = attribs1[VERT1_ATTRIBS*(currVert-1) + NOR_ATTRIB+1];
      attribs1[VERT1_ATTRIBS*currVert + NOR_ATTRIB+2] = attribs1[VERT1_ATTRIBS*(currVert-1) + NOR_ATTRIB+2];
 
-     attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB  ] = attribs1[VERT1_ATTRIBS*(currVert-1) + INF_ATTRIB  ];
-     attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+1] = attribs1[VERT1_ATTRIBS*(currVert-1) + INF_ATTRIB+1];
-     attribs1[VERT1_ATTRIBS*currVert + INF_ATTRIB+2] = attribs1[VERT1_ATTRIBS*(currVert-1) + INF_ATTRIB+2];
-
      attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB  ] = attribs2[VERT2_ATTRIBS*(currVert-1) + TEX_ATTRIB  ];
      attribs2[VERT2_ATTRIBS*currVert + TEX_ATTRIB+1] = attribs2[VERT2_ATTRIBS*(currVert-1) + TEX_ATTRIB+1];
 
diff --git a/src/main/java/org/distorted/library/mesh/MeshQuad.java b/src/main/java/org/distorted/library/mesh/MeshQuad.java
index 51eb4e2..1fec8fc 100644
--- a/src/main/java/org/distorted/library/mesh/MeshQuad.java
+++ b/src/main/java/org/distorted/library/mesh/MeshQuad.java
@@ -40,10 +40,6 @@ public class MeshQuad extends MeshBase
     attribs1[VERT1_ATTRIBS*index + NOR_ATTRIB+1] = 0.0f;
     attribs1[VERT1_ATTRIBS*index + NOR_ATTRIB+2] = 1.0f;
 
-    attribs1[VERT1_ATTRIBS*index + INF_ATTRIB  ] = (x-0.5f);
-    attribs1[VERT1_ATTRIBS*index + INF_ATTRIB+1] = (0.5f-y);
-    attribs1[VERT1_ATTRIBS*index + INF_ATTRIB+2] = 0.01f   ;  // Inflated surface needs to be slightly in front
-
     attribs2[VERT2_ATTRIBS*index + TEX_ATTRIB  ] = x;
     attribs2[VERT2_ATTRIBS*index + TEX_ATTRIB+1] = 1.0f-y;
     }
diff --git a/src/main/java/org/distorted/library/mesh/MeshRectangles.java b/src/main/java/org/distorted/library/mesh/MeshRectangles.java
index 11e5774..80ef94b 100644
--- a/src/main/java/org/distorted/library/mesh/MeshRectangles.java
+++ b/src/main/java/org/distorted/library/mesh/MeshRectangles.java
@@ -67,10 +67,6 @@ public class MeshRectangles extends MeshBase
      attribs1[VERT1_ATTRIBS*vertex + NOR_ATTRIB+1] = 0.0f;
      attribs1[VERT1_ATTRIBS*vertex + NOR_ATTRIB+2] = 1.0f;
 
-     attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB  ] =    x;
-     attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB+1] =   -y;
-     attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB+2] = 0.01f;  // Inflated surface needs to be slightly in front
-
      attribs2[VERT2_ATTRIBS*vertex + TEX_ATTRIB  ] = x+0.5f;
      attribs2[VERT2_ATTRIBS*vertex + TEX_ATTRIB+1] = 0.5f-y;
 
@@ -93,10 +89,6 @@ public class MeshRectangles extends MeshBase
        attribs1[VERT1_ATTRIBS*vertex + NOR_ATTRIB+1] = attribs1[VERT1_ATTRIBS*(vertex-1) + NOR_ATTRIB+1];
        attribs1[VERT1_ATTRIBS*vertex + NOR_ATTRIB+2] = attribs1[VERT1_ATTRIBS*(vertex-1) + NOR_ATTRIB+2];
 
-       attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB  ] = attribs1[VERT1_ATTRIBS*(vertex-1) + INF_ATTRIB  ];
-       attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB+1] = attribs1[VERT1_ATTRIBS*(vertex-1) + INF_ATTRIB+1];
-       attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB+2] = attribs1[VERT1_ATTRIBS*(vertex-1) + INF_ATTRIB+2];
-
        attribs2[VERT2_ATTRIBS*vertex + TEX_ATTRIB  ] = attribs2[VERT2_ATTRIBS*(vertex-1) + TEX_ATTRIB  ];
        attribs2[VERT2_ATTRIBS*vertex + TEX_ATTRIB+1] = attribs2[VERT2_ATTRIBS*(vertex-1) + TEX_ATTRIB+1];
 
diff --git a/src/main/java/org/distorted/library/mesh/MeshSphere.java b/src/main/java/org/distorted/library/mesh/MeshSphere.java
index 213d7c7..0df78d0 100644
--- a/src/main/java/org/distorted/library/mesh/MeshSphere.java
+++ b/src/main/java/org/distorted/library/mesh/MeshSphere.java
@@ -89,10 +89,6 @@ public class MeshSphere extends MeshBase
       attribs1[VERT1_ATTRIBS*currentVert + NOR_ATTRIB+1] = attribs1[VERT1_ATTRIBS*(currentVert-1) + NOR_ATTRIB+1];
       attribs1[VERT1_ATTRIBS*currentVert + NOR_ATTRIB+2] = attribs1[VERT1_ATTRIBS*(currentVert-1) + NOR_ATTRIB+2];
 
-      attribs1[VERT1_ATTRIBS*currentVert + INF_ATTRIB  ] = attribs1[VERT1_ATTRIBS*(currentVert-1) + INF_ATTRIB  ];
-      attribs1[VERT1_ATTRIBS*currentVert + INF_ATTRIB+1] = attribs1[VERT1_ATTRIBS*(currentVert-1) + INF_ATTRIB+1];
-      attribs1[VERT1_ATTRIBS*currentVert + INF_ATTRIB+2] = attribs1[VERT1_ATTRIBS*(currentVert-1) + INF_ATTRIB+2];
-
       attribs2[VERT2_ATTRIBS*currentVert + TEX_ATTRIB  ] = attribs2[VERT2_ATTRIBS*(currentVert-1) + TEX_ATTRIB  ];
       attribs2[VERT2_ATTRIBS*currentVert + TEX_ATTRIB+1] = attribs2[VERT2_ATTRIBS*(currentVert-1) + TEX_ATTRIB+1];
 
@@ -191,10 +187,6 @@ public class MeshSphere extends MeshBase
     attribs1[VERT1_ATTRIBS*currentVert + NOR_ATTRIB  ] = 2*x;//  the vertex coords, normal vector, and
     attribs1[VERT1_ATTRIBS*currentVert + NOR_ATTRIB+1] = 2*y;//  inflate vector have identical (x,y,z).
     attribs1[VERT1_ATTRIBS*currentVert + NOR_ATTRIB+2] = 2*z;//
-                                                             //  TODO: think about some more efficient
-    attribs1[VERT1_ATTRIBS*currentVert + INF_ATTRIB  ] = x;  //  representation.
-    attribs1[VERT1_ATTRIBS*currentVert + INF_ATTRIB+1] = y;  //
-    attribs1[VERT1_ATTRIBS*currentVert + INF_ATTRIB+2] = z;  //
 
     attribs2[VERT2_ATTRIBS*currentVert + TEX_ATTRIB  ] = (float)texX;
     attribs2[VERT2_ATTRIBS*currentVert + TEX_ATTRIB+1] = (float)texY;
diff --git a/src/main/java/org/distorted/library/mesh/MeshTriangles.java b/src/main/java/org/distorted/library/mesh/MeshTriangles.java
index f2bd21e..1df4892 100644
--- a/src/main/java/org/distorted/library/mesh/MeshTriangles.java
+++ b/src/main/java/org/distorted/library/mesh/MeshTriangles.java
@@ -42,10 +42,6 @@ public class MeshTriangles extends MeshBase
      attribs1[VERT1_ATTRIBS*vertex + NOR_ATTRIB+1] = 0.0f;
      attribs1[VERT1_ATTRIBS*vertex + NOR_ATTRIB+2] = 1.0f;
 
-     attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB  ] = (x-0.5f);
-     attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB+1] = (y-0.33f);
-     attribs1[VERT1_ATTRIBS*vertex + INF_ATTRIB+2] = 0.01f   ;  // Inflated surface needs to be slightly in front
-
      attribs2[VERT2_ATTRIBS*vertex + TEX_ATTRIB  ] = x;
      attribs2[VERT2_ATTRIBS*vertex + TEX_ATTRIB+1] = y;
 
diff --git a/src/main/java/org/distorted/library/mesh/UniformBlockAssociation.java b/src/main/java/org/distorted/library/mesh/UniformBlockAssociation.java
new file mode 100644
index 0000000..333ebd0
--- /dev/null
+++ b/src/main/java/org/distorted/library/mesh/UniformBlockAssociation.java
@@ -0,0 +1,95 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2020 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.library.mesh;
+
+import android.opengl.GLES30;
+
+import org.distorted.library.main.InternalBuffer;
+
+import static org.distorted.library.mesh.MeshBase.MAX_EFFECT_COMPONENTS;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class UniformBlockAssociation
+  {
+  private static final int BLOCK_SIZE = 16*MAX_EFFECT_COMPONENTS;
+  private static final int DEFAULT_ASSOCIATION = 0xffffffff;
+
+  private InternalBuffer mUBO;
+  private int[] mAssociations;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  UniformBlockAssociation()
+    {
+    mAssociations= new int[BLOCK_SIZE/4];
+
+    for(int i=0; i<MAX_EFFECT_COMPONENTS; i++)
+      {
+      mAssociations[4*i  ] = DEFAULT_ASSOCIATION;
+      mAssociations[4*i+2] = i;
+      }
+
+    mUBO = new InternalBuffer(GLES30.GL_UNIFORM_BUFFER, GLES30.GL_STATIC_READ);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  UniformBlockAssociation(UniformBlockAssociation original)
+    {
+    int size = original.mAssociations.length;
+    mAssociations= new int[size];
+    System.arraycopy(original.mAssociations, 0, mAssociations, 0, size);
+
+    mUBO = new InternalBuffer(GLES30.GL_UNIFORM_BUFFER, GLES30.GL_STATIC_READ);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   boolean matchesAssociation( int comp, int andAssoc, int equAssoc)
+     {
+     return (andAssoc & mAssociations[4*comp]) != 0 || (equAssoc == mAssociations[4*comp+2]);
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   void setEffectAssociationNow(int comp, int andAssociation, int equAssociation)
+     {
+     mAssociations[4*comp  ] = andAssociation;
+     mAssociations[4*comp+2] = equAssociation;
+
+     mUBO.invalidate();
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   int getIndex()
+     {
+     return mUBO.createImmediatelyInt( BLOCK_SIZE, mAssociations);
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   void copy(int compTo, UniformBlockAssociation assocFrom, int compFrom)
+     {
+     mAssociations[4*compTo  ] = assocFrom.mAssociations[4*compFrom  ];
+     mAssociations[4*compTo+2] = assocFrom.mAssociations[4*compFrom+2];
+     }
+  }
diff --git a/src/main/java/org/distorted/library/mesh/UniformBlockCenter.java b/src/main/java/org/distorted/library/mesh/UniformBlockCenter.java
new file mode 100644
index 0000000..69306fd
--- /dev/null
+++ b/src/main/java/org/distorted/library/mesh/UniformBlockCenter.java
@@ -0,0 +1,82 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2020 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.library.mesh;
+
+import android.opengl.GLES30;
+
+import org.distorted.library.main.InternalBuffer;
+
+import static org.distorted.library.mesh.MeshBase.MAX_EFFECT_COMPONENTS;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+class UniformBlockCenter
+  {
+  private static final int BLOCK_SIZE = 16*MAX_EFFECT_COMPONENTS;
+
+  private InternalBuffer mUBO;
+  private float[] mCenter;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  UniformBlockCenter()
+    {
+    mCenter= new float[BLOCK_SIZE/4];
+    mUBO = new InternalBuffer(GLES30.GL_UNIFORM_BUFFER, GLES30.GL_STATIC_READ);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  UniformBlockCenter(UniformBlockCenter original)
+    {
+    int size = original.mCenter.length;
+    mCenter= new float[size];
+    System.arraycopy(original.mCenter, 0, mCenter, 0, size);
+
+    mUBO = new InternalBuffer(GLES30.GL_UNIFORM_BUFFER, GLES30.GL_STATIC_READ);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   void setEffectCenterNow(int comp, float x, float y, float z)
+     {
+     mCenter[4*comp  ] = x;
+     mCenter[4*comp+1] = y;
+     mCenter[4*comp+2] = z;
+
+     mUBO.invalidate();
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   int getIndex()
+     {
+     return mUBO.createImmediatelyFloat( BLOCK_SIZE, mCenter);
+     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   void copy(int compTo, UniformBlockCenter blockFrom, int compFrom)
+     {
+     mCenter[4*compTo  ] = blockFrom.mCenter[4*compFrom  ];
+     mCenter[4*compTo+1] = blockFrom.mCenter[4*compFrom+1];
+     mCenter[4*compTo+2] = blockFrom.mCenter[4*compFrom+2];
+     }
+  }
diff --git a/src/main/res/raw/main_vertex_shader.glsl b/src/main/res/raw/main_vertex_shader.glsl
index 5272e6f..f76a88e 100644
--- a/src/main/res/raw/main_vertex_shader.glsl
+++ b/src/main/res/raw/main_vertex_shader.glsl
@@ -22,20 +22,13 @@ precision highp int;
 
 in vec3 a_Position;                   // Per-vertex position.
 in vec3 a_Normal;                     // Per-vertex normal vector.
-in vec3 a_Inflate;                    // This vector describes the direction this vertex needs to go when we 'inflate' the whole mesh.
-                                      // If the mesh is locally smooth, this is equal to the normal vector. Otherwise (on sharp edges) - no.
 in vec2 a_TexCoordinate;              // Per-vertex texture coordinate.
 in float a_Component;                 // The component a vertex belongs to.
                                       // to a vertex effect. An effect will only be active on a vertex iff (a_Association & vAssociation[effect]) != 0.
                                       // ( see VertexEffect.retSection() )
 
-out vec3 v_Position;                  //
+out vec3 v_Position;                  // for Transform Feedback only
 out vec3 v_endPosition;               // for Transform Feedback only
-
-#ifdef PREAPPLY
-out vec3 v_Inflate;                   // Transform Feedback for preapply effects
-#endif
-
 out vec3 v_Normal;                    //
 out vec2 v_TexCoordinate;             //
 
@@ -46,6 +39,12 @@ uniform mat4 u_MVMatrixV;             // the combined model/view matrix. (for ve
 uniform float u_Inflate;              // how much should we inflate (>0.0) or deflate (<0.0) the mesh.
 uniform int u_TransformFeedback;      // are we doing the transform feedback now?
 
+layout (std140, binding=4) uniform componentCenter
+  {
+  vec4 vComCenter[MAX_COMPON];        // centers of earch mesh component. 4 floats:
+                                      // (x,y,z,unused)
+  };
+
 #if NUM_VERTEX>0
 uniform int vNumEffects;              // total number of vertex effects
 uniform ivec4 vProperties[NUM_VERTEX];// their properties, 4 ints:
@@ -58,7 +57,7 @@ uniform vec4 vUniforms[3*NUM_VERTEX]; // i-th effect is 3 consecutive vec4's: [3
                                       // The first vec4 is the Interpolated values,
                                       // second vec4: first float - cache, next 3: Center, the third -  the Region.
 
-layout (std140, binding=3) uniform meshAssociation
+layout (std140, binding=3) uniform componentAssociation
   {
   ivec4 vComAssoc[MAX_COMPON];        // component Associations, 4 ints:
                                       // 1: component's AND association
@@ -111,16 +110,12 @@ float degree(in vec4 region, in vec3 PS)
 
 void main()
   {
-  vec3 v = a_Position + u_Inflate*a_Inflate;
+  int component = int(a_Component);
+  vec3 v = a_Position + u_Inflate*(a_Position - vComCenter[component].xyz);
   vec3 n = a_Normal;
 
-#ifdef PREAPPLY
-  vec3 inf = a_Inflate;
-#endif
-
 #if NUM_VERTEX>0
   int effect=0;
-  int component = int(a_Component);
 
   for(int i=0; i<vNumEffects; i++)
     {
@@ -136,7 +131,6 @@ void main()
 #ifdef PREAPPLY
   v_Position   = v;
   v_endPosition= n;
-  v_Inflate    = inf;
 #else
   if( u_TransformFeedback == 1 )
     {
