В следующем коде почему то перемешиваются две текстуры:
@SuppressLint("ResourceType")
    override fun onSurfaceCreated(gl: GL10?, config: javax.microedition.khronos.egl.EGLConfig?) {
        val options = BitmapFactory.Options()
        options.inScaled = false

        val stream = c.resources.openRawResource(R.drawable.water1)
        val bitmap = BitmapFactory.decodeStream(stream, null, options)
        stream.close()

        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture[0])
        GLES20.glTexParameterf(
            GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_MIN_FILTER,
            GLES20.GL_LINEAR.toFloat()
        )
        GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0)
        bitmap?.recycle()

        val stream1 = c.resources.openRawResource(R.drawable.ground)
        val bitmap1 = BitmapFactory.decodeStream(stream1, null, options)
        stream1.close()

        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture[1])
        GLES20.glTexParameterf(
            GLES20.GL_TEXTURE_2D,
            GLES20.GL_TEXTURE_MIN_FILTER,
            GLES20.GL_LINEAR.toFloat()
        )
        GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap1, 0)
        bitmap1?.recycle()



        GLES20.glEnable(GLES20.GL_DEPTH_TEST)
        GLES20.glEnable(GLES20.GL_BLEND)
        GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA)
        val vertex_shader = "uniform mat4 u_modelViewProjectionMatrix;" +
                "attribute vec3 a_vertex;" +
                "attribute vec3 a_normal;" +
                "varying vec3 v_vertex;" +
                "varying vec3 v_normal;" +
                "void main() {" +
                "v_vertex = a_vertex;" +
                "vec3 n_normal = normalize(a_normal);" +
                "v_normal = n_normal;" +
                "gl_Position = u_modelViewProjectionMatrix * vec4(a_vertex, 1.0);" +
                "}"
        val fragment_shader = "precision mediump float;" +
                "uniform vec3 u_camera;" +
                "uniform vec3 u_lightPosition;" +
                "uniform sampler2D u_texture0;" +
                "uniform sampler2D u_texture1;" +
                "uniform float screenHeight;" +
                "uniform float screenWidth;" +
                "varying vec3 v_vertex;" +
                "varying vec3 v_normal;" +

                "vec3 myrefract(vec3 IN, vec3 NORMAL, float k) {" +
                " float nv = dot(NORMAL,IN);" +
                " float v2 = dot(IN,IN);" +
                " float knormal = (sqrt(((k * k - 1.0) * v2) / (nv * nv) + 1.0) - 1.0) * nv;" +
                " vec3 OUT = IN + (knormal * NORMAL);" +
                " return OUT;" +
                "}" +
                "void main() {" +
                " vec3 n_normal = normalize(v_normal);" +
                " vec3 lightvector = normalize(u_lightPosition - v_vertex);" +
                " vec3 lookvector = normalize(u_camera - v_vertex);" +
                " float ambient = 0.1;" +
                " float k_diffuse = 0.7;" +
                " float k_specular = 0.3;" +
                " float diffuse = k_diffuse * max(dot(n_normal, lightvector), 0.0);" +
                " vec3 reflectvector = reflect(-lightvector, n_normal);" +
                " float specular = k_specular * pow( max(dot(lookvector,reflectvector),0.0), 40.0);" +
                " vec4 one = vec4(1.0,1.0,1.0,1.0);" +
                " vec4 lightColor = (ambient + diffuse + specular) * one;" +
                " vec3 OUT = myrefract(-lookvector, n_normal, 1.2);" +
                " float ybottom = 0.0;" +
                " float xbottom = v_vertex.x + OUT.x * (ybottom - v_vertex.y) / OUT.y;" +
                " float zbottom = v_vertex.z + OUT.z * (ybottom - v_vertex.y) / OUT.y;" +
                " vec2 texCoord = vec2(xbottom, zbottom);" +
                "vec2 quadTexCoord = vec2(gl_FragCoord.x / screenWidth, gl_FragCoord.y / screenHeight);" +
                " vec4 textureColor = texture2D(u_texture0, texCoord);" +
                " textureColor.a *= 0.6;" +


                "vec4 textureColor1 = texture2D(u_texture1, quadTexCoord);" +
                " textureColor1.a *= 0.5;" +
                "gl_FragColor = mix(textureColor, textureColor, 0.5) * lightColor;" +
                //" gl_FragColor = lightColor * textureColor;" +
                "}"
fun link_texture(texture: IntArray) {
        val u_texture_Handle1 = GLES20.glGetUniformLocation(program_handle, "u_texture0")
        GLES20.glActiveTexture(GLES20.GL_TEXTURE0)
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture[0])
        GLES20.glUniform1i(u_texture_Handle1, 0)

        val u_texture_Handle2 = GLES20.glGetUniformLocation(program_handle, "u_texture1")
        GLES20.glActiveTexture(GLES20.GL_TEXTURE1)
        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texture[1])
        GLES20.glUniform1i(u_texture_Handle2, 0)
    }





        m_shader = Shader(vertex_shader, fragment_shader)
        m_shader!!.link_vertex_buffer(vertexes_buffer)
        m_shader!!.link_normal_buffer(normales_buffer)
        m_shader!!.link_texture(texture)
    }