commit 68f96a01a389eb603721ffba362ce8d60f72becf
Author: leszek <leszek@koltunski.pl>
Date:   Mon Jul 3 22:52:00 2017 +0100

    Fix in Framebuffer

diff --git a/src/main/java/org/distorted/library/main/DistortedFramebuffer.java b/src/main/java/org/distorted/library/main/DistortedFramebuffer.java
index a2eaf92..caddd14 100644
--- a/src/main/java/org/distorted/library/main/DistortedFramebuffer.java
+++ b/src/main/java/org/distorted/library/main/DistortedFramebuffer.java
@@ -98,6 +98,10 @@ public class DistortedFramebuffer extends DistortedOutputSurface implements Dist
       }
     if( mDepthStencilCreated==DONT_CREATE && mDepthStencilH[0]>0 ) // we need to detach and recreate the DEPTH attachment.
       {
+      // OpenGL ES 3.0.5 spec, chapter 4.4.2.4 :
+      // "Note that the texture image is specifically not detached from any other framebuffer objects.
+      //  Detaching the texture image from any other framebuffer objects is the responsibility of the application."
+      GLES30.glFramebufferTexture2D(GLES30.GL_FRAMEBUFFER, GLES30.GL_DEPTH_STENCIL_ATTACHMENT, GLES30.GL_TEXTURE_2D, 0, 0);
       GLES30.glDeleteTextures(1, mDepthStencilH, 0);
       mDepthStencilH[0]=0;
       }
