commit b36613d81e37fd79d07b9ab734ca8ba8998efcee
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu May 3 01:19:40 2018 +0100

    small correction for blending OIT colors.

diff --git a/src/main/java/org/distorted/library/main/DistortedEffects.java b/src/main/java/org/distorted/library/main/DistortedEffects.java
index 4cbd410..3ea6a0f 100644
--- a/src/main/java/org/distorted/library/main/DistortedEffects.java
+++ b/src/main/java/org/distorted/library/main/DistortedEffects.java
@@ -414,7 +414,7 @@ public class DistortedEffects
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  static void blitDepthPriv(DistortedOutputSurface surface, float corrW, float corrH)
+  static void blitDepth(DistortedOutputSurface surface, float corrW, float corrH)
     {
     mBlitDepthProgram.useProgram();
 
@@ -433,7 +433,7 @@ public class DistortedEffects
 // render all the transparent pixels from the per-pixel linked lists. This is in the 'merge
 // postprocessing buckets' stage.
 
-  static void blitDepthRenderPriv(DistortedOutputSurface surface, float corrW, float corrH)
+  static void mergeOIT(DistortedOutputSurface surface, float corrW, float corrH)
     {
     mBlitDepthRenderProgram.useProgram();
 
diff --git a/src/main/java/org/distorted/library/main/DistortedOutputSurface.java b/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
index df694b7..6609454 100644
--- a/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
+++ b/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
@@ -281,7 +281,7 @@ public static final int DEBUG_FPS = 1;
     GLES31.glDisable(GLES31.GL_STENCIL_TEST);
     GLES31.glStencilMask(0x00);
 
-    DistortedEffects.blitDepthPriv(this, buffer.getWidthCorrection(), buffer.getHeightCorrection() );
+    DistortedEffects.blitDepth(this, buffer.getWidthCorrection(), buffer.getHeightCorrection() );
     GLES31.glActiveTexture(GLES31.GL_TEXTURE0);
     GLES31.glBindTexture(GLES31.GL_TEXTURE_2D, 0);
     GLES31.glActiveTexture(GLES31.GL_TEXTURE1);
@@ -292,7 +292,7 @@ public static final int DEBUG_FPS = 1;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private int blitWithDepthRender(long currTime, DistortedOutputSurface buffer)
+  private int mergeOIT(long currTime, DistortedOutputSurface buffer)
     {
     GLES31.glViewport(0, 0, mWidth, mHeight);
     setAsOutput(currTime);
@@ -301,7 +301,7 @@ public static final int DEBUG_FPS = 1;
 
     DistortedRenderState.enableStencil();
 
-    DistortedEffects.blitDepthRenderPriv(this, buffer.getWidthCorrection(), buffer.getHeightCorrection() );
+    DistortedEffects.mergeOIT(this, buffer.getWidthCorrection(), buffer.getHeightCorrection() );
     GLES31.glActiveTexture(GLES31.GL_TEXTURE1);
     GLES31.glBindTexture(GLES31.GL_TEXTURE_2D, 0);
 
@@ -390,7 +390,7 @@ public static final int DEBUG_FPS = 1;
           numRenders += currQueue.postprocess(mBuffer);
           numRenders += blitWithDepth(time, mBuffer[quality]);
           GLES31.glMemoryBarrier(GLES31.GL_ALL_BARRIER_BITS);
-          numRenders += blitWithDepthRender(time,mBuffer[quality]);  // merge the OIT linked list
+          numRenders += mergeOIT(time,mBuffer[quality]);  // merge the OIT linked list
           clearBuffer(mBuffer[quality]);
           }
         }
diff --git a/src/main/res/raw/blit_depth_render_fragment_shader.glsl b/src/main/res/raw/blit_depth_render_fragment_shader.glsl
index cfcc064..3d07385 100644
--- a/src/main/res/raw/blit_depth_render_fragment_shader.glsl
+++ b/src/main/res/raw/blit_depth_render_fragment_shader.glsl
@@ -60,16 +60,20 @@ void main()
   uint curr = u_Records[index];
 
   if (curr == 0u) discard;
+  else
+    {
+    u_Records[index] = 0u;
 
-  vec4 color= vec4(0.0,0.0,0.0,0.0);
-  u_Records[index] = 0u;
+    vec4 color= vec4(0.0,0.0,1.0,1.0);//convert(u_Records[curr+2u]);
+    curr = u_Records[curr];
 
-  while (curr > 0u)
-    {
-    color= blend( color, convert(u_Records[curr+2u]) );  // keep walking the linked list
-    curr = u_Records[curr];                              // and blending the colors in
-    }
+    while (curr > 0u)
+      {
+      color= vec4(0.0,0.0,0.0,1.0);//blend( color, convert(u_Records[curr+2u]) );  // keep walking the linked list
+      curr = u_Records[curr];                              // and blending the colors in
+      }
 
-  gl_FragDepth = texture(u_DepthTexture, v_TexCoordinate).r;
-  fragColor    = color;
+    gl_FragDepth = texture(u_DepthTexture, v_TexCoordinate).r;
+    fragColor    = color;
+    }
   }
\ No newline at end of file
