Is there way to handle rendering order of different shapes (vertices arrays)?
The green plane should be in front of blue ones:
override fun onDrawFrame(unused: GL10) {
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT)
Matrix.setLookAtM(
view,
0,
eyeValue.x, eyeValue.y, eyeValue.z,
0f, 0f, 0f,
0f, 1.0f, 0.0f
)
Matrix.multiplyMM(mvp, 0, projection, 0, view, 0)
shapes.forEach {
it.onDraw(mvp)
}
}
open fun onDraw(mvp: FloatArray) {
program.onDrawStart()
program.setV4(uNames.uColor, arrayColor)
program.setV4Matrix(uNames.uMvp, mvp)
program.drawVertexes(vertexes.buffer)
}
