commit 9ab3b71276660635ae11046ca2e4db4904ae3641
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu May 17 17:10:45 2018 +0100

    Make us read only the DEPTH part of a DEPTH24_STENCIL8 attachment.

diff --git a/src/main/java/org/distorted/library/main/DistortedOutputSurface.java b/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
index b57e314..9a06777 100644
--- a/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
+++ b/src/main/java/org/distorted/library/main/DistortedOutputSurface.java
@@ -356,12 +356,13 @@ public abstract class DistortedOutputSurface extends DistortedSurface implements
 
     DistortedRenderState.enableStencil();
 
-    // we cannot compare DEPTH24_STENCIL8 format to DEPTH32 which oitRender's fragment shader expects. Remount!
+    // we cannot compare DEPTH24_STENCIL8 format to DEPTH32 which oitRender's fragment shader expects.
+
     if( mDepthStencil==BOTH_DEPTH_STENCIL )
       {
       GLES31.glBindFramebuffer(GLES31.GL_FRAMEBUFFER, mFBOH[0]);
       GLES31.glFramebufferTexture2D(GLES31.GL_FRAMEBUFFER, GLES31.GL_DEPTH_STENCIL_ATTACHMENT, GLES31.GL_TEXTURE_2D, 0, 0);
-      GLES31.glFramebufferTexture2D(GLES31.GL_FRAMEBUFFER, GLES31.GL_DEPTH_ATTACHMENT, GLES31.GL_TEXTURE_2D, mDepthStencilH[0], 0);
+      GLES31.glTexParameteri(GLES31.GL_TEXTURE_2D, GLES31.GL_DEPTH_STENCIL_TEXTURE_MODE, GLES31.GL_DEPTH_COMPONENT);
       }
 
     DistortedEffects.oitRender(this, buffer.getWidthCorrection(), buffer.getHeightCorrection() );
@@ -369,7 +370,6 @@ public abstract class DistortedOutputSurface extends DistortedSurface implements
     if( mDepthStencil==BOTH_DEPTH_STENCIL )
       {
       GLES31.glBindFramebuffer(GLES31.GL_FRAMEBUFFER, mFBOH[0]);
-      GLES31.glFramebufferTexture2D(GLES31.GL_FRAMEBUFFER, GLES31.GL_DEPTH_ATTACHMENT, GLES31.GL_TEXTURE_2D, 0, 0);
       GLES31.glFramebufferTexture2D(GLES31.GL_FRAMEBUFFER, GLES31.GL_DEPTH_STENCIL_ATTACHMENT, GLES31.GL_TEXTURE_2D, mDepthStencilH[0], 0);
       }
 
