commit 2dacdeb21749937bcf0e445cb5ab5ede7248b7d6
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Wed Jun 29 17:15:46 2016 +0100

    remove the 'Color' vertex attribute.

diff --git a/src/main/java/org/distorted/library/Distorted.java b/src/main/java/org/distorted/library/Distorted.java
index 58b1cbb..605dd48 100644
--- a/src/main/java/org/distorted/library/Distorted.java
+++ b/src/main/java/org/distorted/library/Distorted.java
@@ -86,7 +86,6 @@ public class Distorted
   private static boolean mInitialized = false;
   
   static int mPositionH;      // pass in model position information
-  static int mColorH;         // pass in model color information
   static int mTextureUniformH;// pass in the texture.
   static int mNormalH;        // pass in model normal information.
   static int mTextureCoordH;  // pass in model texture coordinate information.
@@ -352,8 +351,7 @@ public class Distorted
     mTextureUniformH = GLES20.glGetUniformLocation(mProgramH, "u_Texture");
     
     mPositionH       = GLES20.glGetAttribLocation( mProgramH, "a_Position");
-    mColorH          = GLES20.glGetAttribLocation( mProgramH, "a_Color");
-    mNormalH         = GLES20.glGetAttribLocation( mProgramH, "a_Normal"); 
+    mNormalH         = GLES20.glGetAttribLocation( mProgramH, "a_Normal");
     mTextureCoordH   = GLES20.glGetAttribLocation( mProgramH, "a_TexCoordinate");
     
     EffectQueueFragment.getUniforms(mProgramH);
@@ -361,7 +359,6 @@ public class Distorted
     EffectQueueMatrix.getUniforms(mProgramH);
     
     GLES20.glEnableVertexAttribArray(mPositionH);        
-    GLES20.glEnableVertexAttribArray(mColorH);
     GLES20.glEnableVertexAttribArray(mNormalH);
     GLES20.glEnableVertexAttribArray(mTextureCoordH);
    
diff --git a/src/main/java/org/distorted/library/DistortedBitmapGrid.java b/src/main/java/org/distorted/library/DistortedBitmapGrid.java
index 959f95f..cc65166 100644
--- a/src/main/java/org/distorted/library/DistortedBitmapGrid.java
+++ b/src/main/java/org/distorted/library/DistortedBitmapGrid.java
@@ -50,20 +50,7 @@ class DistortedBitmapGrid extends DistortedObjectGrid
 
     // for(int g=0; g<dataLength; g++) Log.e(TAG_BACKGROUND, "index["+g+"]="+indexData[g]);
 
-    float[] bufferData= new float[COLOR_DATA_SIZE*dataLength];
-
-    offset=0;
-    for(int i=0; i<dataLength; i++)
-      {
-      bufferData[offset++] = 1.0f; // r
-      bufferData[offset++] = 1.0f; // g
-      bufferData[offset++] = 1.0f; // b
-      bufferData[offset++] = 1.0f; // a
-      }
-    mGridColors = ByteBuffer.allocateDirect(COLOR_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();                                                        
-    mGridColors.put(bufferData).position(0); 
-
-    bufferData = new float[NORMAL_DATA_SIZE*dataLength];
+    float[] bufferData = new float[NORMAL_DATA_SIZE*dataLength];
 
     offset=0;
     for(int i=0; i<dataLength; i++)
diff --git a/src/main/java/org/distorted/library/DistortedCubesGrid.java b/src/main/java/org/distorted/library/DistortedCubesGrid.java
index f66356a..1e379f6 100644
--- a/src/main/java/org/distorted/library/DistortedCubesGrid.java
+++ b/src/main/java/org/distorted/library/DistortedCubesGrid.java
@@ -713,18 +713,9 @@ class DistortedCubesGrid extends DistortedObjectGrid
       buildGrid(cols,desc,frontOnly);
        
       int numVertices=0;
-      float[] colorData   = new float[COLOR_DATA_SIZE   *dataLength];
       float[] positionData= new float[POSITION_DATA_SIZE*dataLength];
       float[] normalData  = new float[NORMAL_DATA_SIZE  *dataLength];
       float[] textureData = new float[TEX_DATA_SIZE     *dataLength];
-      
-      for(int i=0; i<dataLength; i++)
-        {
-        colorData[COLOR_DATA_SIZE*i  ] = 1.0f; // r
-        colorData[COLOR_DATA_SIZE*i+1] = 1.0f; // g
-        colorData[COLOR_DATA_SIZE*i+2] = 1.0f; // b
-        colorData[COLOR_DATA_SIZE*i+3] = 1.0f; // a
-        }
 
       numVertices = buildFrontBackGrid(true, numVertices,positionData,normalData,textureData);
       
@@ -741,8 +732,6 @@ class DistortedCubesGrid extends DistortedObjectGrid
       android.util.Log.d("CUBES", "normal: "  +debug(  normalData,3) );
       android.util.Log.d("CUBES", "texture: " +debug( textureData,2) );
       */
-      mGridColors = ByteBuffer.allocateDirect(COLOR_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();                                                        
-      mGridColors.put(colorData).position(0); 
 
       mGridPositions = ByteBuffer.allocateDirect(POSITION_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();                                                        
       mGridPositions.put(positionData).position(0); 
diff --git a/src/main/java/org/distorted/library/DistortedObjectGrid.java b/src/main/java/org/distorted/library/DistortedObjectGrid.java
index d547a82..50fcfa0 100644
--- a/src/main/java/org/distorted/library/DistortedObjectGrid.java
+++ b/src/main/java/org/distorted/library/DistortedObjectGrid.java
@@ -29,7 +29,6 @@ abstract class DistortedObjectGrid
    {
    protected static final int BYTES_PER_FLOAT   = 4; //
    protected static final int POSITION_DATA_SIZE= 3; // Size of the position data in elements
-   protected static final int COLOR_DATA_SIZE   = 4; // Size of the color data in elements 
    protected static final int NORMAL_DATA_SIZE  = 3; // Size of the normal data in elements.
    protected static final int TEX_DATA_SIZE     = 2; // Size of the texture coordinate data in elements. 
 
@@ -42,7 +41,6 @@ abstract class DistortedObjectGrid
    void draw()
      { 
      GLES20.glVertexAttribPointer(Distorted.mPositionH    , POSITION_DATA_SIZE, GLES20.GL_FLOAT, false, 0, mGridPositions);          
-     GLES20.glVertexAttribPointer(Distorted.mColorH       , COLOR_DATA_SIZE   , GLES20.GL_FLOAT, false, 0, mGridColors   );   
      GLES20.glVertexAttribPointer(Distorted.mNormalH      , NORMAL_DATA_SIZE  , GLES20.GL_FLOAT, false, 0, mGridNormals  );
      GLES20.glVertexAttribPointer(Distorted.mTextureCoordH, TEX_DATA_SIZE     , GLES20.GL_FLOAT, false, 0, mGridTexture  );  
 
diff --git a/src/main/res/raw/main_fragment_shader.glsl b/src/main/res/raw/main_fragment_shader.glsl
index dc65ee9..8dab8b5 100644
--- a/src/main/res/raw/main_fragment_shader.glsl
+++ b/src/main/res/raw/main_fragment_shader.glsl
@@ -93,7 +93,7 @@ void saturation(float degree, int effect, inout vec4 color)
 void main()                    		
   {  
   vec2 tex = v_TexCoordinate;
-  vec4 col = v_Color;
+  vec4 col = vec4(1.0,1.0,1.0,1.0);
   vec2 diff;
   float pointDegree;
   
diff --git a/src/main/res/raw/main_vertex_shader.glsl b/src/main/res/raw/main_vertex_shader.glsl
index 90d46ac..5f98bb2 100644
--- a/src/main/res/raw/main_vertex_shader.glsl
+++ b/src/main/res/raw/main_vertex_shader.glsl
@@ -29,13 +29,11 @@ uniform mat4 u_MVPMatrix;                 // A constant representing the combine
 uniform mat4 u_MVMatrix;                  // A constant representing the combined model/view matrix.       		
 		 
 attribute vec3 a_Position;                // Per-vertex position information we will pass in.   				
-attribute vec4 a_Color;                   // Per-vertex color information we will pass in. 				
-attribute vec3 a_Normal;                  // Per-vertex normal information we will pass in.      
+attribute vec3 a_Normal;                  // Per-vertex normal information we will pass in.
 attribute vec2 a_TexCoordinate;           // Per-vertex texture coordinate information we will pass in. 		
 		  
 varying vec3 v_Position;                  //      		
-varying vec4 v_Color;                     // Those will be passed into the fragment shader.          		
-varying vec3 v_Normal;                    //  
+varying vec3 v_Normal;                    //
 varying vec2 v_TexCoordinate;             //  		
 
 uniform int vNumEffects;                  // total number of vertex effects
@@ -351,8 +349,7 @@ void main()
 #endif
    
   v_Position      = vec3(u_MVMatrix*v);           
-  v_Color         = a_Color;              
-  v_TexCoordinate = a_TexCoordinate;                                         
+  v_TexCoordinate = a_TexCoordinate;
   v_Normal        = normalize(vec3(u_MVMatrix*n));
   gl_Position     = u_MVPMatrix*v;      
   }                               
