commit 61441ce2fc1e80d218c4e61d56c53092c4c16d6c
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri Apr 6 14:28:07 2018 +0100

    A little progress making the postprocessing buffers static.

diff --git a/src/main/java/org/distorted/library/main/DistortedOutputSurface.java b/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
index afe6c62..7d8558c 100644
--- a/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
+++ b/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
@@ -79,7 +79,8 @@ public static final int DEBUG_FPS = 1;
 
   private ArrayList<Job> mJobs = new ArrayList<>();
 
-  DistortedOutputSurface[] mBuffer;
+  // buffers used for postprocessing.
+  private DistortedOutputSurface[] mBuffer;
 
   private long mTime;
   private float mFOV;
@@ -99,10 +100,10 @@ public static final int DEBUG_FPS = 1;
 
   private int mDebugLevel;
 
-  protected int mRealWidth;   // the Surface can be backed up with a texture that is
-  protected int mRealHeight;  // larger than the viewport we have to it.
-                              // mWidth,mHeight are the sizes of the Viewport, those -
-                              // sizes of the backing up texture.
+  int mRealWidth;   // the Surface can be backed up with a texture that is
+  int mRealHeight;  // larger than the viewport we have to it.
+                    // mWidth,mHeight are the sizes of the Viewport, those -
+                    // sizes of the backing up texture.
 
   ////////////////////////////////////////////////////////////////////////////////
   // section dealing with Shader Storage Buffer Object (for counting transparency)
@@ -415,7 +416,7 @@ public static final int DEBUG_FPS = 1;
               numRenders += child2.markStencilAndDepth(time,mBuffer[internalQuality],lastQueue);
               }
 
-            numRenders += lastQueue.postprocess(this);
+            numRenders += lastQueue.postprocess(mBuffer);
             numRenders += blitWithDepth(time, mBuffer[quality]);
             }
 
@@ -425,7 +426,6 @@ public static final int DEBUG_FPS = 1;
           }
 
         child1.draw(time,mBuffer[quality]);
-        //numRenders += currQueue.draw(child1,time,mBuffer);
 
         if( i==numChildren-1 )
           {
@@ -435,7 +435,7 @@ public static final int DEBUG_FPS = 1;
             numRenders += child2.markStencilAndDepth(time,mBuffer[internalQuality],currQueue);
             }
 
-          numRenders += currQueue.postprocess(this);
+          numRenders += currQueue.postprocess(mBuffer);
           numRenders += blitWithDepth(time, mBuffer[quality]);
           }
         }
@@ -693,8 +693,8 @@ public static final int DEBUG_FPS = 1;
  * @param fov Vertical 'field of view' of the Projection frustrum (in degrees).
  *            Valid values: 0<=fov<180. FOV==0 means 'parallel projection'.
  * @param near Distance between the screen plane and the near plane.
- *             Valid vaules: 0<near<1. When near==0, the Near Plane is exactly at the tip of the
- *             pyramid. When near==1 (illegal!) the near plane is equivalent to the screen plane.
+ *             Valid vaules: 0<near<1. When near==0 (illegal!), the Near Plane is exactly at the tip of
+ *             the pyramid. When near==1 (illegal!) the near plane is equivalent to the screen plane.
  */
   public void setProjection(float fov, float near)
     {
diff --git a/src/main/java/org/distorted/library/main/EffectQueuePostprocess.java b/src/main/java/org/distorted/library/main/EffectQueuePostprocess.java
index d0c57d7..6c7a74e 100644
--- a/src/main/java/org/distorted/library/main/EffectQueuePostprocess.java
+++ b/src/main/java/org/distorted/library/main/EffectQueuePostprocess.java
@@ -99,13 +99,13 @@ class EffectQueuePostprocess extends EffectQueue
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  int postprocess(DistortedOutputSurface surface)
+  int postprocess(DistortedOutputSurface[] buffers)
     {
     int numRenders = 0;
 
     for(int i=0; i<mNumEffects; i++)
       {
-      numRenders += ((PostprocessEffect)mEffects[i]).apply(mUniforms,NUM_UNIFORMS*i, surface.mBuffer);
+      numRenders += ((PostprocessEffect)mEffects[i]).apply(mUniforms,NUM_UNIFORMS*i, buffers);
       }
 
     return numRenders;
